From a17bf91d306847051395f8eafe1c920d6824a998 Mon Sep 17 00:00:00 2001 From: skulltrail Date: Tue, 8 Jun 2021 01:32:33 -0300 Subject: [PATCH] Enabling uiribbon, fixing compilation and rewrite all include to new way, to turn wrappers highly portable --- CMakeLists.txt | 10 +- sdk/include/reactos/wine/CMakeLists.txt | 20 +- wrappers/CMakeLists.txt | 2 - .../base/kernelbase_wrapper/CMakeLists.txt | 2 +- wrappers/includes/CMakeLists.txt | 14 - wrappers/includes/evr.idl | 327 -- wrappers/new-dlls/CMakeLists.txt | 6 +- wrappers/new-dlls/avrt/avrt.h | 74 - wrappers/new-dlls/gamingtcui/Makefile.in | 6 + wrappers/new-dlls/gamingtcui/gamingtcui.spec | 26 + .../new-dlls/gamingtcui/gamingtcui_main.c | 61 + wrappers/new-dlls/mf/CMakeLists.txt | 2 - wrappers/new-dlls/npmshtml/Makefile.in | 7 + wrappers/new-dlls/npmshtml/main.c | 39 + wrappers/new-dlls/npmshtml/npmshtml.spec | 3 + wrappers/new-dlls/npmshtml/rsrc.rc | 26 + wrappers/new-dlls/opcservices/Makefile.in | 14 + wrappers/new-dlls/opcservices/compress.c | 334 ++ wrappers/new-dlls/opcservices/deflate.c | 2974 +++++++++++++ wrappers/new-dlls/opcservices/factory.c | 483 ++ wrappers/new-dlls/opcservices/opc_private.h | 69 + wrappers/new-dlls/opcservices/opcservices.idl | 21 + .../new-dlls/opcservices/opcservices.spec | 4 + wrappers/new-dlls/opcservices/package.c | 2053 +++++++++ .../new-dlls/opcservices/tests/Makefile.in | 5 + .../new-dlls/opcservices/tests/opcservices.c | 1322 ++++++ wrappers/new-dlls/opcservices/uri.c | 609 +++ wrappers/new-dlls/opcservices/zlib.h | 162 + wrappers/new-dlls/prntvpt/Makefile.in | 9 + wrappers/new-dlls/prntvpt/main.c | 110 + wrappers/new-dlls/prntvpt/prntvpt.spec | 27 + .../prntvpt/prntvpt_private.h} | 23 +- wrappers/new-dlls/prntvpt/tests/Makefile.in | 5 + wrappers/new-dlls/prntvpt/tests/prntvpt.c | 148 + wrappers/new-dlls/prntvpt/ticket.c | 1538 +++++++ wrappers/new-dlls/sechost/Makefile.in | 15 + wrappers/new-dlls/sechost/plugplay.idl | 2 + wrappers/new-dlls/sechost/sechost.spec | 208 + wrappers/new-dlls/sechost/security.c | 1235 ++++++ wrappers/new-dlls/sechost/service.c | 2119 +++++++++ wrappers/new-dlls/sechost/svcctl.idl | 3 + wrappers/new-dlls/sechost/trace.c | 155 + wrappers/new-dlls/sppc/Makefile.in | 6 + wrappers/new-dlls/sppc/sppc.c | 52 + wrappers/new-dlls/sppc/sppc.spec | 67 + wrappers/new-dlls/srvcli/Makefile.in | 5 + wrappers/new-dlls/srvcli/main.c | 41 + wrappers/new-dlls/srvcli/srvcli.spec | 61 + wrappers/new-dlls/strmbase/Makefile.in | 12 + wrappers/new-dlls/strmbase/dispatch.c | 83 + wrappers/new-dlls/strmbase/filter.c | 550 +++ wrappers/new-dlls/strmbase/mediatype.c | 205 + wrappers/new-dlls/strmbase/outputqueue.c | 275 ++ wrappers/new-dlls/strmbase/pin.c | 1215 +++++ wrappers/new-dlls/strmbase/pospass.c | 766 ++++ wrappers/new-dlls/strmbase/qualitycontrol.c | 317 ++ wrappers/new-dlls/strmbase/renderer.c | 353 ++ wrappers/new-dlls/strmbase/seeking.c | 324 ++ wrappers/new-dlls/strmbase/strmbase_private.h | 61 + wrappers/new-dlls/strmiids/Makefile.in | 5 + wrappers/new-dlls/strmiids/evr.c | 25 + wrappers/new-dlls/strmiids/strmiids.c | 41 + wrappers/new-dlls/svrapi/Makefile.in | 6 + wrappers/new-dlls/svrapi/svrapi.spec | 20 + wrappers/new-dlls/svrapi/svrapi_main.c | 46 + wrappers/new-dlls/ucrtbase/Makefile.in | 47 + wrappers/new-dlls/ucrtbase/printf.c | 34 + wrappers/new-dlls/ucrtbase/tests/Makefile.in | 10 + wrappers/new-dlls/ucrtbase/tests/cpp.c | 197 + wrappers/new-dlls/ucrtbase/tests/misc.c | 1414 ++++++ wrappers/new-dlls/ucrtbase/tests/printf.c | 864 ++++ wrappers/new-dlls/ucrtbase/tests/scanf.c | 298 ++ wrappers/new-dlls/ucrtbase/tests/string.c | 552 +++ wrappers/new-dlls/ucrtbase/ucrtbase.spec | 2599 +++++++++++ wrappers/new-dlls/ucrtbase/version.rc | 26 + wrappers/new-dlls/uianimation/Makefile.in | 11 + wrappers/new-dlls/uianimation/main.c | 1227 +++++ .../new-dlls/uianimation/tests/Makefile.in | 5 + .../new-dlls/uianimation/tests/uianimation.c | 159 + .../new-dlls/uianimation/uianimation.spec | 4 + .../new-dlls/uianimation/uianimation_reg.idl | 57 + .../uianimation/uianimation_typelib.idl | 23 + wrappers/new-dlls/uiribbon/CMakeLists.txt | 26 + wrappers/new-dlls/uiribbon/Makefile.in | 10 - wrappers/new-dlls/uiribbon/main.c | 29 + wrappers/new-dlls/uiribbon/version.rc | 26 + wrappers/new-dlls/wevtsvc/Makefile.in | 7 + wrappers/new-dlls/wevtsvc/wevtsvc.c | 87 + wrappers/new-dlls/wevtsvc/wevtsvc.spec | 1 + wrappers/new-dlls/wpcap/Makefile.in | 8 + wrappers/new-dlls/wpcap/version.rc | 26 + wrappers/new-dlls/wpcap/wpcap.c | 400 ++ wrappers/new-dlls/wpcap/wpcap.spec | 78 + wrappers/sdk/include/wsdk/CMakeLists.txt | 39 + wrappers/sdk/include/wsdk/activation.idl | 31 + .../sdk/include/wsdk}/avrt.h | 0 .../include/wsdk}/comm_version.rc | 0 .../sdk/include/wsdk}/d3d10.idl | 0 .../sdk/include/wsdk}/d3d10_1.idl | 0 .../sdk/include/wsdk}/d3d10_1shader.h | 0 .../sdk/include/wsdk}/d3d10sdklayers.idl | 0 .../sdk/include/wsdk}/d3d10shader.h | 0 .../sdk/include/wsdk}/d3d11.idl | 0 .../sdk/include/wsdk}/d3d11sdklayers.idl | 0 .../sdk/include/wsdk}/dxgi.idl | 0 .../sdk/include/wsdk}/dxgicommon.idl | 0 .../sdk/include/wsdk}/dxgiformat.idl | 0 .../sdk/include/wsdk}/dxgitype.idl | 0 .../include/wsdk}/dxva2api.idl | 0 .../sdk/include/wsdk}/evr.idl | 0 .../{includes => sdk/include/wsdk}/evr9.idl | 0 wrappers/sdk/include/wsdk/gameux.idl | 201 + wrappers/sdk/include/wsdk/hstring.idl | 41 + wrappers/sdk/include/wsdk/inspectable.idl | 41 + .../sdk/include/wsdk}/irpcss.idl | 0 .../sdk/include/wsdk}/mfapi.h | 0 .../sdk/include/wsdk}/mferror.h | 0 .../sdk/include/wsdk}/mfmediaengine.idl | 0 .../sdk/include/wsdk}/mfplay.idl | 0 .../sdk/include/wsdk}/mfreadwrite.idl | 0 .../include/wsdk}/msvcrt/corecrt.h | 0 .../include/wsdk}/msvcrt/limits.h | 0 .../include/wsdk}/ntdllbase.h | 0 .../sdk/include/wsdk}/orpc.idl | 0 .../sdk/include/wsdk}/restartmanager.h | 0 .../sdk/include/wsdk/restrictederrorinfo.idl | 35 + .../sdk/include/wsdk}/roapi.h | 0 .../sdk/include/wsdk}/roerrorapi.h | 0 .../sdk/include/wsdk/roparameterizediid.idl | 95 + .../sdk/include/wsdk}/rtworkq.idl | 0 .../sdk/include/wsdk}/schrpc.idl | 0 .../sdk/include/wsdk}/shellscalingapi.h | 0 .../sdk/include/wsdk}/strmbase.h | 0 .../include/wsdk}/threadpool.h | 0 .../include/wsdk}/threadpoolapiset.h | 0 .../sdk/include/wsdk/uiautomationclient.idl | 149 + .../sdk/include/wsdk/uiautomationcore.idl | 91 + .../sdk/include/wsdk}/uiautomationcoreapi.h | 0 wrappers/sdk/include/wsdk/uiribbon.idl | 310 ++ .../sdk/include/wsdk}/winstring.h | 0 .../wpc => sdk/include/wsdk}/wpcapi.idl | 0 wrappers/{ => sdk}/lib/CMakeLists.txt | 0 wrappers/{ => sdk}/lib/mfuuid/CMakeLists.txt | 0 wrappers/{ => sdk}/lib/mfuuid/mfplay.c | 0 wrappers/{ => sdk}/lib/mfuuid/mfuuid.c | 0 wrappers/to-synch/CMakeLists.txt | 285 ++ wrappers/to-synch/sdk/include/dxsdk/avrt.h | 75 - wrappers/to-synch/sdk/include/dxsdk/mfapi.h | 599 --- wrappers/to-synch/sdk/include/dxsdk/mferror.h | 400 -- .../sdk/include/psdk/restartmanager.h | 79 - .../sdk/include/psdk/shellscalingapi.h | 51 - .../sdk/include/psdk/uiautomationcoreapi.h | 78 - .../sdk/include/reactos/wine/CMakeLists.txt | 20 - .../sdk/include/reactos/wine/d3d10.idl | 1649 ------- .../sdk/include/reactos/wine/d3d10_1.idl | 157 - .../sdk/include/reactos/wine/d3d10_1shader.h | 52 - .../include/reactos/wine/d3d10sdklayers.idl | 719 --- .../sdk/include/reactos/wine/d3d10shader.h | 233 - .../sdk/include/reactos/wine/d3d11.idl | 3951 ----------------- .../include/reactos/wine/d3d11sdklayers.idl | 1303 ------ .../sdk/include/reactos/wine/dxgi.idl | 503 --- .../sdk/include/reactos/wine/dxgicommon.idl | 61 - .../sdk/include/reactos/wine/dxgiformat.idl | 145 - .../sdk/include/reactos/wine/dxgitype.idl | 94 - .../to-synch/sdk/include/reactos/wine/evr.idl | 327 -- .../sdk/include/reactos/wine/irpcss.idl | 50 - .../include/reactos/wine/mfmediaengine.idl | 347 -- .../sdk/include/reactos/wine/mfplay.idl | 413 -- .../sdk/include/reactos/wine/mfreadwrite.idl | 293 -- .../sdk/include/reactos/wine/orpc.idl | 191 - .../to-synch/sdk/include/reactos/wine/roapi.h | 54 - .../sdk/include/reactos/wine/rtworkq.idl | 124 - .../sdk/include/reactos/wine/schrpc.idl | 101 - .../sdk/include/reactos/wine/strmbase.h | 814 ---- .../sdk/include/reactos/wine/winstring.h | 54 - 175 files changed, 27888 insertions(+), 13400 deletions(-) delete mode 100644 wrappers/includes/CMakeLists.txt delete mode 100644 wrappers/includes/evr.idl delete mode 100644 wrappers/new-dlls/avrt/avrt.h create mode 100644 wrappers/new-dlls/gamingtcui/Makefile.in create mode 100644 wrappers/new-dlls/gamingtcui/gamingtcui.spec create mode 100644 wrappers/new-dlls/gamingtcui/gamingtcui_main.c create mode 100644 wrappers/new-dlls/npmshtml/Makefile.in create mode 100644 wrappers/new-dlls/npmshtml/main.c create mode 100644 wrappers/new-dlls/npmshtml/npmshtml.spec create mode 100644 wrappers/new-dlls/npmshtml/rsrc.rc create mode 100644 wrappers/new-dlls/opcservices/Makefile.in create mode 100644 wrappers/new-dlls/opcservices/compress.c create mode 100644 wrappers/new-dlls/opcservices/deflate.c create mode 100644 wrappers/new-dlls/opcservices/factory.c create mode 100644 wrappers/new-dlls/opcservices/opc_private.h create mode 100644 wrappers/new-dlls/opcservices/opcservices.idl create mode 100644 wrappers/new-dlls/opcservices/opcservices.spec create mode 100644 wrappers/new-dlls/opcservices/package.c create mode 100644 wrappers/new-dlls/opcservices/tests/Makefile.in create mode 100644 wrappers/new-dlls/opcservices/tests/opcservices.c create mode 100644 wrappers/new-dlls/opcservices/uri.c create mode 100644 wrappers/new-dlls/opcservices/zlib.h create mode 100644 wrappers/new-dlls/prntvpt/Makefile.in create mode 100644 wrappers/new-dlls/prntvpt/main.c create mode 100644 wrappers/new-dlls/prntvpt/prntvpt.spec rename wrappers/{to-synch/sdk/include/psdk/roerrorapi.h => new-dlls/prntvpt/prntvpt_private.h} (67%) create mode 100644 wrappers/new-dlls/prntvpt/tests/Makefile.in create mode 100644 wrappers/new-dlls/prntvpt/tests/prntvpt.c create mode 100644 wrappers/new-dlls/prntvpt/ticket.c create mode 100644 wrappers/new-dlls/sechost/Makefile.in create mode 100644 wrappers/new-dlls/sechost/plugplay.idl create mode 100644 wrappers/new-dlls/sechost/sechost.spec create mode 100644 wrappers/new-dlls/sechost/security.c create mode 100644 wrappers/new-dlls/sechost/service.c create mode 100644 wrappers/new-dlls/sechost/svcctl.idl create mode 100644 wrappers/new-dlls/sechost/trace.c create mode 100644 wrappers/new-dlls/sppc/Makefile.in create mode 100644 wrappers/new-dlls/sppc/sppc.c create mode 100644 wrappers/new-dlls/sppc/sppc.spec create mode 100644 wrappers/new-dlls/srvcli/Makefile.in create mode 100644 wrappers/new-dlls/srvcli/main.c create mode 100644 wrappers/new-dlls/srvcli/srvcli.spec create mode 100644 wrappers/new-dlls/strmbase/Makefile.in create mode 100644 wrappers/new-dlls/strmbase/dispatch.c create mode 100644 wrappers/new-dlls/strmbase/filter.c create mode 100644 wrappers/new-dlls/strmbase/mediatype.c create mode 100644 wrappers/new-dlls/strmbase/outputqueue.c create mode 100644 wrappers/new-dlls/strmbase/pin.c create mode 100644 wrappers/new-dlls/strmbase/pospass.c create mode 100644 wrappers/new-dlls/strmbase/qualitycontrol.c create mode 100644 wrappers/new-dlls/strmbase/renderer.c create mode 100644 wrappers/new-dlls/strmbase/seeking.c create mode 100644 wrappers/new-dlls/strmbase/strmbase_private.h create mode 100644 wrappers/new-dlls/strmiids/Makefile.in create mode 100644 wrappers/new-dlls/strmiids/evr.c create mode 100644 wrappers/new-dlls/strmiids/strmiids.c create mode 100644 wrappers/new-dlls/svrapi/Makefile.in create mode 100644 wrappers/new-dlls/svrapi/svrapi.spec create mode 100644 wrappers/new-dlls/svrapi/svrapi_main.c create mode 100644 wrappers/new-dlls/ucrtbase/Makefile.in create mode 100644 wrappers/new-dlls/ucrtbase/printf.c create mode 100644 wrappers/new-dlls/ucrtbase/tests/Makefile.in create mode 100644 wrappers/new-dlls/ucrtbase/tests/cpp.c create mode 100644 wrappers/new-dlls/ucrtbase/tests/misc.c create mode 100644 wrappers/new-dlls/ucrtbase/tests/printf.c create mode 100644 wrappers/new-dlls/ucrtbase/tests/scanf.c create mode 100644 wrappers/new-dlls/ucrtbase/tests/string.c create mode 100644 wrappers/new-dlls/ucrtbase/ucrtbase.spec create mode 100644 wrappers/new-dlls/ucrtbase/version.rc create mode 100644 wrappers/new-dlls/uianimation/Makefile.in create mode 100644 wrappers/new-dlls/uianimation/main.c create mode 100644 wrappers/new-dlls/uianimation/tests/Makefile.in create mode 100644 wrappers/new-dlls/uianimation/tests/uianimation.c create mode 100644 wrappers/new-dlls/uianimation/uianimation.spec create mode 100644 wrappers/new-dlls/uianimation/uianimation_reg.idl create mode 100644 wrappers/new-dlls/uianimation/uianimation_typelib.idl create mode 100644 wrappers/new-dlls/uiribbon/CMakeLists.txt delete mode 100644 wrappers/new-dlls/uiribbon/Makefile.in create mode 100644 wrappers/new-dlls/uiribbon/version.rc create mode 100644 wrappers/new-dlls/wevtsvc/Makefile.in create mode 100644 wrappers/new-dlls/wevtsvc/wevtsvc.c create mode 100644 wrappers/new-dlls/wevtsvc/wevtsvc.spec create mode 100644 wrappers/new-dlls/wpcap/Makefile.in create mode 100644 wrappers/new-dlls/wpcap/version.rc create mode 100644 wrappers/new-dlls/wpcap/wpcap.c create mode 100644 wrappers/new-dlls/wpcap/wpcap.spec create mode 100644 wrappers/sdk/include/wsdk/CMakeLists.txt create mode 100644 wrappers/sdk/include/wsdk/activation.idl rename {sdk/include/dxsdk => wrappers/sdk/include/wsdk}/avrt.h (100%) rename wrappers/{includes => sdk/include/wsdk}/comm_version.rc (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d10.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d10_1.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d10_1shader.h (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d10sdklayers.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d10shader.h (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d11.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/d3d11sdklayers.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/dxgi.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/dxgicommon.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/dxgiformat.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/dxgitype.idl (100%) rename wrappers/{includes => sdk/include/wsdk}/dxva2api.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/evr.idl (100%) rename wrappers/{includes => sdk/include/wsdk}/evr9.idl (100%) create mode 100644 wrappers/sdk/include/wsdk/gameux.idl create mode 100644 wrappers/sdk/include/wsdk/hstring.idl create mode 100644 wrappers/sdk/include/wsdk/inspectable.idl rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/irpcss.idl (100%) rename {sdk/include/dxsdk => wrappers/sdk/include/wsdk}/mfapi.h (100%) rename {sdk/include/dxsdk => wrappers/sdk/include/wsdk}/mferror.h (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/mfmediaengine.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/mfplay.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/mfreadwrite.idl (100%) rename wrappers/{includes => sdk/include/wsdk}/msvcrt/corecrt.h (100%) rename wrappers/{includes => sdk/include/wsdk}/msvcrt/limits.h (100%) rename wrappers/{includes => sdk/include/wsdk}/ntdllbase.h (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/orpc.idl (100%) rename {sdk/include/psdk => wrappers/sdk/include/wsdk}/restartmanager.h (100%) create mode 100644 wrappers/sdk/include/wsdk/restrictederrorinfo.idl rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/roapi.h (100%) rename {sdk/include/psdk => wrappers/sdk/include/wsdk}/roerrorapi.h (100%) create mode 100644 wrappers/sdk/include/wsdk/roparameterizediid.idl rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/rtworkq.idl (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/schrpc.idl (100%) rename {sdk/include/psdk => wrappers/sdk/include/wsdk}/shellscalingapi.h (100%) rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/strmbase.h (100%) rename wrappers/{includes => sdk/include/wsdk}/threadpool.h (100%) rename wrappers/{includes => sdk/include/wsdk}/threadpoolapiset.h (100%) create mode 100644 wrappers/sdk/include/wsdk/uiautomationclient.idl create mode 100644 wrappers/sdk/include/wsdk/uiautomationcore.idl rename {sdk/include/psdk => wrappers/sdk/include/wsdk}/uiautomationcoreapi.h (100%) create mode 100644 wrappers/sdk/include/wsdk/uiribbon.idl rename {sdk/include/reactos/wine => wrappers/sdk/include/wsdk}/winstring.h (100%) rename wrappers/{new-dlls/wpc => sdk/include/wsdk}/wpcapi.idl (100%) rename wrappers/{ => sdk}/lib/CMakeLists.txt (100%) rename wrappers/{ => sdk}/lib/mfuuid/CMakeLists.txt (100%) rename wrappers/{ => sdk}/lib/mfuuid/mfplay.c (100%) rename wrappers/{ => sdk}/lib/mfuuid/mfuuid.c (100%) create mode 100644 wrappers/to-synch/CMakeLists.txt delete mode 100644 wrappers/to-synch/sdk/include/dxsdk/avrt.h delete mode 100644 wrappers/to-synch/sdk/include/dxsdk/mfapi.h delete mode 100644 wrappers/to-synch/sdk/include/dxsdk/mferror.h delete mode 100644 wrappers/to-synch/sdk/include/psdk/restartmanager.h delete mode 100644 wrappers/to-synch/sdk/include/psdk/shellscalingapi.h delete mode 100644 wrappers/to-synch/sdk/include/psdk/uiautomationcoreapi.h delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/CMakeLists.txt delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d10.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d10_1.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d10_1shader.h delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d10sdklayers.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d10shader.h delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d11.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/d3d11sdklayers.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/dxgi.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/dxgicommon.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/dxgiformat.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/dxgitype.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/evr.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/irpcss.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/mfmediaengine.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/mfplay.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/mfreadwrite.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/orpc.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/roapi.h delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/rtworkq.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/schrpc.idl delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/strmbase.h delete mode 100644 wrappers/to-synch/sdk/include/reactos/wine/winstring.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 49db16b884c..7231d18374d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,14 +215,16 @@ else() include_directories( sdk/include sdk/include/psdk - sdk/include/dxsdk + sdk/include/dxsdk ${REACTOS_BINARY_DIR}/sdk/include ${REACTOS_BINARY_DIR}/sdk/include/psdk ${REACTOS_BINARY_DIR}/sdk/include/dxsdk ${REACTOS_BINARY_DIR}/sdk/include/ddk ${REACTOS_BINARY_DIR}/sdk/include/reactos ${REACTOS_BINARY_DIR}/sdk/include/reactos/mc - ${REACTOS_BINARY_DIR}/wrappers/includes + #Please, include these directories when integrate wrappers to reactos environment + wrappers/sdk/include/wsdk + ${REACTOS_BINARY_DIR}/wrappers/sdk/include/wsdk sdk/include/crt sdk/include/ddk sdk/include/ndk @@ -271,7 +273,11 @@ else() add_subdirectory(subsystems) add_subdirectory(sdk/tools/wpp) add_subdirectory(win32ss) + + #Please, include these directories when integrate wrappers to reactos environment add_subdirectory(wrappers) + add_subdirectory(wrappers/sdk/include/wsdk) + add_subdirectory(wrappers/sdk/lib) # Create the registry hives create_registry_hives() diff --git a/sdk/include/reactos/wine/CMakeLists.txt b/sdk/include/reactos/wine/CMakeLists.txt index ba6ea5ee363..709ed1b8c23 100644 --- a/sdk/include/reactos/wine/CMakeLists.txt +++ b/sdk/include/reactos/wine/CMakeLists.txt @@ -1,20 +1,2 @@ -add_idl_headers(wineheaders - fil_data.idl - itss.idl - evr.idl - orpc.idl - rtworkq.idl - d3d10.idl - d3d10_1.idl - d3d10sdklayers.idl - d3d11sdklayers.idl - d3d11.idl - dxgi.idl - dxgitype.idl - dxgicommon.idl - mfmediaengine.idl - mfplay.idl - mfreadwrite.idl - schrpc.idl - ) +add_idl_headers(wineheaders fil_data.idl itss.idl) diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt index cedfd79175e..4eddd1c0f08 100644 --- a/wrappers/CMakeLists.txt +++ b/wrappers/CMakeLists.txt @@ -4,6 +4,4 @@ add_subdirectory(base) add_subdirectory(dependencies) add_subdirectory(drivers) add_subdirectory(ext-sets) -add_subdirectory(includes) -add_subdirectory(lib) add_subdirectory(new-dlls) diff --git a/wrappers/base/kernelbase_wrapper/CMakeLists.txt b/wrappers/base/kernelbase_wrapper/CMakeLists.txt index 3e8748e2938..eb0d8f7813d 100644 --- a/wrappers/base/kernelbase_wrapper/CMakeLists.txt +++ b/wrappers/base/kernelbase_wrapper/CMakeLists.txt @@ -9,7 +9,7 @@ include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine ${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys ${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys/win - ${REACTOS_SOURCE_DIR}/wrappers/includes) + ${REACTOS_SOURCE_DIR}/wrappers/sdk/include/wsdk) spec2def(kernelbase.dll kernelbase.spec ADD_IMPORTLIB) list(APPEND SOURCE diff --git a/wrappers/includes/CMakeLists.txt b/wrappers/includes/CMakeLists.txt deleted file mode 100644 index 352170524f4..00000000000 --- a/wrappers/includes/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ - -add_definitions(-D_MIDL_USE_GUIDDEF_) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -list(APPEND SOURCE - dxva2api.idl - evr9.idl - mfidl.idl - mftransform.idl - ) - -add_idl_headers(wsdk ${SOURCE}) -add_dependencies(wsdk xdk) \ No newline at end of file diff --git a/wrappers/includes/evr.idl b/wrappers/includes/evr.idl deleted file mode 100644 index 413f5af1d47..00000000000 --- a/wrappers/includes/evr.idl +++ /dev/null @@ -1,327 +0,0 @@ -/* - * COM Classes for evr - * - * Copyright 2017 Fabian Maurer - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "unknwn.idl"; -import "propidl.idl"; -import "mfidl.idl"; -import "mftransform.idl"; -import "mediaobj.idl"; -import "strmif.idl"; - -cpp_quote("#ifndef _MFVideoNormalizedRect_") -cpp_quote("#define _MFVideoNormalizedRect_") -typedef struct MFVideoNormalizedRect -{ - float left; - float top; - float right; - float bottom; -} MFVideoNormalizedRect; -cpp_quote("#endif") - -typedef enum _MFVP_MESSAGE_TYPE { - MFVP_MESSAGE_FLUSH, - MFVP_MESSAGE_INVALIDATEMEDIATYPE, - MFVP_MESSAGE_PROCESSINPUTNOTIFY, - MFVP_MESSAGE_BEGINSTREAMING, - MFVP_MESSAGE_ENDSTREAMING, - MFVP_MESSAGE_ENDOFSTREAM, - MFVP_MESSAGE_STEP, - MFVP_MESSAGE_CANCELSTEP, -} MFVP_MESSAGE_TYPE; - -[ - object, - uuid(29aff080-182a-4a5d-af3b-448f3a6346cb), - local -] -interface IMFVideoPresenter : IMFClockStateSink -{ - HRESULT ProcessMessage( - [in] MFVP_MESSAGE_TYPE eMessage, - [in] ULONG_PTR ulParam - ); - HRESULT GetCurrentMediaType( - [out] IMFVideoMediaType **ppMediaType - ); -} - -[ - object, - uuid(83e91e85-82c1-4ea7-801d-85dc50b75086), - local -] -interface IEVRFilterConfig : IUnknown -{ - HRESULT SetNumberOfStreams( - [in] DWORD dwMaxStreams - ); - HRESULT GetNumberOfStreams( - [out] DWORD *pdwMaxStreams - ); -} - -[ - object, - uuid(1f6a9f17-e70b-4e24-8ae4-0b2c3ba7a4ae), - local -] -interface IMFVideoPositionMapper : IUnknown -{ - HRESULT MapOutputCoordinateToInputStream( - [in] float xOut, - [in] float yOut, - [in] DWORD dwOutputStreamIndex, - [in] DWORD dwInputStreamIndex, - [out] float *pxIn, - [out] float *pyIn - ); -} - -[ - object, - uuid(dfdfd197-a9ca-43d8-b341-6af3503792cd), - local -] -interface IMFVideoRenderer : IUnknown -{ - HRESULT InitializeRenderer( - [in] IMFTransform *pVideoMixer, - [in] IMFVideoPresenter *pVideoPresenter - ); -} - -typedef enum _MF_SERVICE_LOOKUP_TYPE -{ - MF_SERVICE_LOOKUP_UPSTREAM, - MF_SERVICE_LOOKUP_UPSTREAM_DIRECT, - MF_SERVICE_LOOKUP_DOWNSTREAM, - MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT, - MF_SERVICE_LOOKUP_ALL, - MF_SERVICE_LOOKUP_GLOBAL, -} MF_SERVICE_LOOKUP_TYPE; - -[ - object, - uuid(fa993889-4383-415a-a930-dd472a8cf6f7), - local -] -interface IMFTopologyServiceLookup : IUnknown -{ - HRESULT LookupService( - [in] MF_SERVICE_LOOKUP_TYPE lookup_type, - [in] DWORD index, - [in] REFGUID service, - [in] REFIID riid, - [out, iid_is(riid)] void **objects, - [in, out] DWORD *num_objects - ); -} - -[ - object, - uuid(fa99388a-4383-415a-a930-dd472a8cf6f7), - local -] -interface IMFTopologyServiceLookupClient : IUnknown -{ - HRESULT InitServicePointers( - [in] IMFTopologyServiceLookup *service_lookup - ); - HRESULT ReleaseServicePointers(); -} - -[ - object, - uuid(a38d9567-5a9c-4f3c-b293-8eb415b279ba), - local -] -interface IMFVideoDeviceID : IUnknown -{ - HRESULT GetDeviceID( - [out] IID *device_id - ); -} - -[ - object, - uuid(a5c6c53f-c202-4aa5-9695-175ba8c508a5) -] -interface IMFVideoMixerControl : IUnknown -{ - HRESULT SetStreamZOrder( - [in] DWORD stream_id, - [in] DWORD zorder - ); - HRESULT GetStreamZOrder( - [in] DWORD stream_id, - [out] DWORD *zorder - ); - HRESULT SetStreamOutputRect( - [in] DWORD stream_id, - [in] const MFVideoNormalizedRect *rect - ); - HRESULT GetStreamOutputRect( - [in] DWORD stream_id, - [out] MFVideoNormalizedRect *rect - ); -} - -typedef enum _MFVideoMixPrefs -{ - MFVideoMixPrefs_ForceHalfInterlace = 0x00000001, - MFVideoMixPrefs_AllowDropToHalfInterlace = 0x00000002, - MFVideoMixPrefs_AllowDropToBob = 0x00000004, - MFVideoMixPrefs_ForceBob = 0x00000008, - MFVideoMixPrefs_EnableRotation = 0x00000010, - MFVideoMixPrefs_Mask = 0x0000001f, -} MFVideoMixPrefs; - -[ - object, - uuid(8459616d-966e-4930-b658-54fa7e5a16d3) -] -interface IMFVideoMixerControl2 : IMFVideoMixerControl -{ - HRESULT SetMixingPrefs( - [in] DWORD flags - ); - HRESULT GetMixingPrefs( - [out] DWORD *flags - ); -} - -[ - object, - uuid(56c294d0-753e-4260-8d61-a3d8820b1d54), - local -] -interface IMFDesiredSample : IUnknown -{ - HRESULT GetDesiredSampleTimeAndDuration( - [out] LONGLONG *sample_time, - [out] LONGLONG *sample_duration - ); - - void SetDesiredSampleTimeAndDuration( - [in] LONGLONG sample_time, - [in] LONGLONG sample_duration - ); - - void Clear(); -} - -typedef enum MFVideoAspectRatioMode -{ - MFVideoARMode_None = 0x00000000, - MFVideoARMode_PreservePicture = 0x00000001, - MFVideoARMode_PreservePixel = 0x00000002, - MFVideoARMode_NonLinearStretch = 0x00000004, - MFVideoARMode_Mask = 0x00000007, -} MFVideoAspectRatioMode; - -[ - object, - uuid(a490b1e4-ab84-4d31-a1b2-181e03b1077a), -] -interface IMFVideoDisplayControl : IUnknown -{ - HRESULT GetNativeVideoSize( - [in, out, unique] SIZE *video_size, - [in, out, unique] SIZE *aspect_ratio - ); - - HRESULT GetIdealVideoSize( - [in, out, unique] SIZE *min_size, - [in, out, unique] SIZE *max_size - ); - - HRESULT SetVideoPosition( - [in, unique] const MFVideoNormalizedRect *source, - [in, unique] const RECT *dest - ); - - HRESULT GetVideoPosition( - [out] MFVideoNormalizedRect *source, - [out] RECT *dest - ); - - HRESULT SetAspectRatioMode( - [in] DWORD mode - ); - - HRESULT GetAspectRatioMode( - [out] DWORD *mode - ); - - HRESULT SetVideoWindow( - [in] HWND window - ); - - HRESULT GetVideoWindow( - [out] HWND *window - ); - - HRESULT RepaintVideo(); - - HRESULT GetCurrentImage( - [in, out] LPBITMAPINFOHEADER header, - [out, size_is(, *dib_size)] BYTE **dib, - [out] DWORD *dib_size, - [in, out, unique] LONGLONG *timestamp - ); - - HRESULT SetBorderColor( - [in] COLORREF color - ); - - HRESULT GetBorderColor( - [out] COLORREF *color - ); - - HRESULT SetRenderingPrefs( - [in] DWORD flags - ); - - HRESULT GetRenderingPrefs( - [out] DWORD *flags - ); - - HRESULT SetFullscreen( - [in] BOOL fullscreen - ); - - HRESULT GetFullscreen( - [out] BOOL *fullscreen - ); -} - -cpp_quote("DEFINE_GUID(MR_VIDEO_RENDER_SERVICE, 0x1092a86c, 0xab1a, 0x459a, 0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff);") -cpp_quote("DEFINE_GUID(MR_VIDEO_MIXER_SERVICE, 0x073cd2fc, 0x6cf4, 0x40b7, 0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8);") -cpp_quote("DEFINE_GUID(MR_VIDEO_ACCELERATION_SERVICE, 0xefef5175, 0x5c7d, 0x4ce2, 0xbb, 0xbd, 0x34, 0xff, 0x8b, 0xca, 0x65, 0x54);") -cpp_quote("DEFINE_GUID(MR_BUFFER_SERVICE, 0xa562248c, 0x9ac6, 0x4ffc, 0x9f, 0xba, 0x3a, 0xf8, 0xf8, 0xad, 0x1a, 0x4d);") -cpp_quote("DEFINE_GUID(VIDEO_ZOOM_RECT, 0x7aaa1638, 0x1b7f, 0x4c93, 0xbd, 0x89, 0x5b, 0x9c, 0x9f, 0xb6, 0xfc, 0xf0);") -cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") -cpp_quote("HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *presenter_outer, ") -cpp_quote(" REFIID riid_mixer, void **mixer, REFIID riid_presenter, void **presenter);") -cpp_quote("HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") -cpp_quote("HRESULT WINAPI MFCreateVideoRenderer(REFIID riid, void **renderer);") -cpp_quote("HRESULT WINAPI MFCreateVideoSampleAllocator(REFIID riid, void **allocator);") -cpp_quote("HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sample);") diff --git a/wrappers/new-dlls/CMakeLists.txt b/wrappers/new-dlls/CMakeLists.txt index 4cc61ea8f3f..4c3e7e45d95 100644 --- a/wrappers/new-dlls/CMakeLists.txt +++ b/wrappers/new-dlls/CMakeLists.txt @@ -23,9 +23,13 @@ add_subdirectory(sspicli) add_subdirectory(taskschd) add_subdirectory(tdh) add_subdirectory(uiautomationcore) -#add_subdirectory(uiribbon) +add_subdirectory(uiribbon) #add_subdirectory(vssapi) # add_subdirectory(wdscore) add_subdirectory(wer) #add_subdirectory(wevtapi) +#add_subdirectory(wimgapi) +#add_subdirectory(winusb) +#add_subdirectory(xpsprint) +#add_subdirectory(xpssvcs) add_subdirectory(wpc) \ No newline at end of file diff --git a/wrappers/new-dlls/avrt/avrt.h b/wrappers/new-dlls/avrt/avrt.h deleted file mode 100644 index 2d0ab096bf4..00000000000 --- a/wrappers/new-dlls/avrt/avrt.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * avrt definitions - * - * Copyright 2009 Maarten Lankhorst - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#ifndef _AVRT_ -#define _AVRT_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum _AVRT_PRIORITY -{ - AVRT_PRIORITY_LOW = -1, - AVRT_PRIORITY_NORMAL, - AVRT_PRIORITY_HIGH, - AVRT_PRIORITY_CRITICAL -} AVRT_PRIORITY, *PAVRT_PRIORITY; - -/* Windows compiler is more lax */ -#define THREAD_ORDER_GROUP_INFINITE_TIMEOUT ((void*)((LONG_PTR)-1)) - -HANDLE WINAPI AvSetMmThreadCharacteristicsA(LPCSTR TaskName, LPDWORD TaskIndex); -HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex); -#define AvSetMmThreadCharacteristics WINELIB_NAME_AW(AvSetMmThreadCharacteristics) - -HANDLE WINAPI AvSetMmMaxThreadCharacteristicsA(LPCSTR FirstTask, LPCSTR SecondTask, LPDWORD TaskIndex); -HANDLE WINAPI AvSetMmMaxThreadCharacteristicsW(LPCSTR FirstTask, LPCSTR SecondTask, LPDWORD TaskIndex); -#define AvSetMmMaxThreadCharacteristics WINELIB_NAME_AW(AvSetMmMaxThreadCharacteristics) - -BOOL WINAPI AvRevertMmThreadCharacteristics(HANDLE AvrtHandle); -BOOL WINAPI AvSetMmThreadPriority(HANDLE AvrtHandle, AVRT_PRIORITY Priority); -BOOL WINAPI AvRtCreateThreadOrderingGroup( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout); - -BOOL WINAPI AvRtCreateThreadOrderingGroupExA( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout, - LPCSTR TaskName); -BOOL WINAPI AvRtCreateThreadOrderingGroupExW( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout, - LPCSTR TaskName); -#define AvRtCreateThreadOrderingGroupEx WINELIB_NAME_AW(AvRtCreateThreadOrderingGroupEx) - -BOOL WINAPI AvRtJoinThreadOrderingGroup(PHANDLE Context, GUID *ThreadOrderingGuid, BOOL Before); -BOOL WINAPI AvRtWaitOnThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvRtLeaveThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvRtDeleteThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvQuerySystemResponsiveness(HANDLE AvrtHandle, PULONG SystemResponsivenessValue); - -#ifdef __cplusplus -} -#endif - -#endif /*_AVRT_*/ diff --git a/wrappers/new-dlls/gamingtcui/Makefile.in b/wrappers/new-dlls/gamingtcui/Makefile.in new file mode 100644 index 00000000000..cc89ce1fdb5 --- /dev/null +++ b/wrappers/new-dlls/gamingtcui/Makefile.in @@ -0,0 +1,6 @@ +MODULE = gamingtcui.dll + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + gamingtcui_main.c diff --git a/wrappers/new-dlls/gamingtcui/gamingtcui.spec b/wrappers/new-dlls/gamingtcui/gamingtcui.spec new file mode 100644 index 00000000000..a0c2d52ad74 --- /dev/null +++ b/wrappers/new-dlls/gamingtcui/gamingtcui.spec @@ -0,0 +1,26 @@ +@ stub CheckGamingPrivilegeSilently +@ stub CheckGamingPrivilegeSilentlyForUser +@ stub CheckGamingPrivilegeWithUI +@ stub CheckGamingPrivilegeWithUIForUser +@ stdcall ProcessPendingGameUI(long) +@ stub ShowChangeFriendRelationshipUI +@ stub ShowChangeFriendRelationshipUIForUser +@ stub ShowCustomizeUserProfileUI +@ stub ShowCustomizeUserProfileUIForUser +@ stub ShowFindFriendsUI +@ stub ShowFindFriendsUIForUser +@ stub ShowGameInfoUI +@ stub ShowGameInfoUIForUser +@ stub ShowGameInviteUI +@ stub ShowGameInviteUIForUser +@ stub ShowGameInviteUIWithContext +@ stub ShowGameInviteUIWithContextForUser +@ stdcall ShowPlayerPickerUI(ptr ptr long ptr long long long ptr ptr) +@ stub ShowPlayerPickerUIForUser +@ stdcall ShowProfileCardUI(ptr ptr ptr) +@ stub ShowProfileCardUIForUser +@ stub ShowTitleAchievementsUI +@ stub ShowTitleAchievementsUIForUser +@ stub ShowUserSettingsUI +@ stub ShowUserSettingsUIForUser +@ stub TryCancelPendingGameUI diff --git a/wrappers/new-dlls/gamingtcui/gamingtcui_main.c b/wrappers/new-dlls/gamingtcui/gamingtcui_main.c new file mode 100644 index 00000000000..555b6d781d3 --- /dev/null +++ b/wrappers/new-dlls/gamingtcui/gamingtcui_main.c @@ -0,0 +1,61 @@ +/* + * Copyright 2021 Paul Gofman for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "gamingtcui.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(gamingtcui); + +HRESULT WINAPI ProcessPendingGameUI(BOOL wait_for_completion) +{ + FIXME("wait_for_completion %#x stub.\n", wait_for_completion); + + return S_OK; +} + +HRESULT WINAPI ShowPlayerPickerUI(HSTRING prompt_display_text, const HSTRING *xuids, size_t xuid_count, + const HSTRING *preselected_xuids, size_t preselected_xuid_count, size_t min_selection_count, + size_t max_selection_count, PlayerPickerUICompletionRoutine completion_routine, void *context) +{ + FIXME("prompt_display_text %p, xuids %p, xuid_count %lu, preselected_xuids %p, preselected_xuid_count %lu," + " min_selection_count %lu, max_selection_count %lu, completion_routine %p, context %p semi-stub.\n", + prompt_display_text, xuids, (SIZE_T)xuid_count, preselected_xuids, (SIZE_T)preselected_xuid_count, + (SIZE_T)min_selection_count, (SIZE_T)max_selection_count, completion_routine, context); + + if (completion_routine) + completion_routine(S_OK, context, preselected_xuids, preselected_xuid_count); + + return S_OK; +} + +HRESULT WINAPI ShowProfileCardUI(HSTRING target_user_xuid, GameUICompletionRoutine completion_routine, void *context) +{ + FIXME("target_user_xuid %p, completion_routine %p, context %p stub.\n", + target_user_xuid, completion_routine, context); + + if (completion_routine) + completion_routine(S_OK, context); + + return S_OK; +} diff --git a/wrappers/new-dlls/mf/CMakeLists.txt b/wrappers/new-dlls/mf/CMakeLists.txt index d7acf5404b9..9221261a302 100644 --- a/wrappers/new-dlls/mf/CMakeLists.txt +++ b/wrappers/new-dlls/mf/CMakeLists.txt @@ -20,8 +20,6 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/mf.def) add_idl_headers(mf_idlheader mf.idl) -# add_typelib(mf.idl) -# add_rpcproxy_files(mf.idl) add_library(mf SHARED ${SOURCE} mf.rc) add_dependencies(mf mf_idlheader stdole2 dxsdk) diff --git a/wrappers/new-dlls/npmshtml/Makefile.in b/wrappers/new-dlls/npmshtml/Makefile.in new file mode 100644 index 00000000000..61e057c4fe7 --- /dev/null +++ b/wrappers/new-dlls/npmshtml/Makefile.in @@ -0,0 +1,7 @@ +MODULE = npmshtml.dll +IMPORTS = mshtml + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = main.c +RC_SRCS = rsrc.rc diff --git a/wrappers/new-dlls/npmshtml/main.c b/wrappers/new-dlls/npmshtml/main.c new file mode 100644 index 00000000000..f3124c92444 --- /dev/null +++ b/wrappers/new-dlls/npmshtml/main.c @@ -0,0 +1,39 @@ +/* + * Copyright 2010 Jacek Caban for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" + + +/*********************************************************************** + * NP_Initialize (npmshtml.@) + */ +INT16 WINAPI NP_Initialize(void *arg) +{ + return 0; +} + +/*********************************************************************** + * NP_Shutdown (npmshtml.@) + */ +INT16 WINAPI NP_Shutdown(void) +{ + return 0; +} diff --git a/wrappers/new-dlls/npmshtml/npmshtml.spec b/wrappers/new-dlls/npmshtml/npmshtml.spec new file mode 100644 index 00000000000..e0b6dea7a6d --- /dev/null +++ b/wrappers/new-dlls/npmshtml/npmshtml.spec @@ -0,0 +1,3 @@ +1 stdcall NP_GetEntryPoints(ptr) mshtml.NP_GetEntryPoints +2 stdcall NP_Initialize(ptr) +3 stdcall NP_Shutdown() diff --git a/wrappers/new-dlls/npmshtml/rsrc.rc b/wrappers/new-dlls/npmshtml/rsrc.rc new file mode 100644 index 00000000000..07622668653 --- /dev/null +++ b/wrappers/new-dlls/npmshtml/rsrc.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2010 Jacek Caban for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine ActiveX plugin" +#define WINE_FILENAME_STR "npmshtml.dll" +#define WINE_CODEPAGE 04E4 /* need to set "Windows Multilingual" */ +#define WINE_EXTRAVALUES \ + VALUE "OLESelfRegister", "" \ + VALUE "MIMEType", "application/x-oleobject" + +#include "wine/wine_common_ver.rc" diff --git a/wrappers/new-dlls/opcservices/Makefile.in b/wrappers/new-dlls/opcservices/Makefile.in new file mode 100644 index 00000000000..b55c79826d4 --- /dev/null +++ b/wrappers/new-dlls/opcservices/Makefile.in @@ -0,0 +1,14 @@ +MODULE = opcservices.dll +IMPORTS = uuid ole32 advapi32 urlmon xmllite oleaut32 + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + compress.c \ + deflate.c \ + factory.c \ + package.c \ + uri.c + +IDL_SRCS = \ + opcservices.idl diff --git a/wrappers/new-dlls/opcservices/compress.c b/wrappers/new-dlls/opcservices/compress.c new file mode 100644 index 00000000000..0ee876512c1 --- /dev/null +++ b/wrappers/new-dlls/opcservices/compress.c @@ -0,0 +1,334 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include + +#include "windef.h" +#include "winternl.h" +#include "msopc.h" + +#include "opc_private.h" +#include "zlib.h" + +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msopc); + +#include +struct local_file_header +{ + DWORD signature; + WORD version; + WORD flags; + WORD method; + DWORD mtime; + DWORD crc32; + DWORD compressed_size; + DWORD uncompressed_size; + WORD name_length; + WORD extra_length; +}; + +struct data_descriptor +{ + DWORD signature; + DWORD crc32; + DWORD compressed_size; + DWORD uncompressed_size; +}; + +struct central_directory_header +{ + DWORD signature; + WORD version; + WORD min_version; + WORD flags; + WORD method; + DWORD mtime; + DWORD crc32; + DWORD compressed_size; + DWORD uncompressed_size; + WORD name_length; + WORD extra_length; + WORD comment_length; + WORD diskid; + WORD internal_attributes; + DWORD external_attributes; + DWORD local_file_offset; +}; + +struct central_directory_end +{ + DWORD signature; + WORD diskid; + WORD firstdisk; + WORD records_num; + WORD records_total; + DWORD directory_size; + DWORD directory_offset; + WORD comment_length; +}; +#include + +#define CENTRAL_DIR_SIGNATURE 0x02014b50 +#define LOCAL_HEADER_SIGNATURE 0x04034b50 +#define DIRECTORY_END_SIGNATURE 0x06054b50 +#define DATA_DESCRIPTOR_SIGNATURE 0x08074b50 +#define VERSION 20 + +enum entry_flags +{ + USE_DATA_DESCRIPTOR = 0x8, +}; + +struct zip_archive +{ + struct central_directory_header **files; + size_t file_count; + size_t file_size; + + DWORD mtime; + IStream *output; + DWORD position; + HRESULT write_result; + + unsigned char input_buffer[0x8000]; + unsigned char output_buffer[0x8000]; +}; + +HRESULT compress_create_archive(IStream *output, struct zip_archive **out) +{ + struct zip_archive *archive; + WORD date, time; + FILETIME ft; + + if (!(archive = heap_alloc(sizeof(*archive)))) + return E_OUTOFMEMORY; + + archive->files = NULL; + archive->file_size = 0; + archive->file_count = 0; + archive->write_result = S_OK; + + archive->output = output; + IStream_AddRef(archive->output); + archive->position = 0; + + GetSystemTimeAsFileTime(&ft); + FileTimeToDosDateTime(&ft, &date, &time); + archive->mtime = date << 16 | time; + + *out = archive; + + return S_OK; +} + +static void compress_write(struct zip_archive *archive, void *data, ULONG size) +{ + ULONG written; + + archive->write_result = IStream_Write(archive->output, data, size, &written); + if (written != size) + archive->write_result = E_FAIL; + else + archive->position += written; + + if (FAILED(archive->write_result)) + WARN("Failed to write output %p, size %u, written %u, hr %#x.\n", data, size, written, archive->write_result); +} + +void compress_finalize_archive(struct zip_archive *archive) +{ + struct central_directory_end dir_end = { 0 }; + size_t i; + + dir_end.directory_offset = archive->position; + dir_end.records_num = archive->file_count; + dir_end.records_total = archive->file_count; + + /* Directory entries */ + for (i = 0; i < archive->file_count; ++i) + { + compress_write(archive, archive->files[i], sizeof(*archive->files[i])); + compress_write(archive, archive->files[i] + 1, archive->files[i]->name_length); + dir_end.directory_size += archive->files[i]->name_length + sizeof(*archive->files[i]); + } + + /* End record */ + dir_end.signature = DIRECTORY_END_SIGNATURE; + compress_write(archive, &dir_end, sizeof(dir_end)); + + IStream_Release(archive->output); + + for (i = 0; i < archive->file_count; i++) + heap_free(archive->files[i]); + heap_free(archive->files); + heap_free(archive); +} + +static void compress_write_content(struct zip_archive *archive, IStream *content, + OPC_COMPRESSION_OPTIONS options, struct data_descriptor *data_desc) +{ + int level, flush; + z_stream z_str; + LARGE_INTEGER move; + ULONG num_read; + HRESULT hr; + + data_desc->crc32 = RtlComputeCrc32(0, NULL, 0); + move.QuadPart = 0; + IStream_Seek(content, move, STREAM_SEEK_SET, NULL); + + switch (options) + { + case OPC_COMPRESSION_NONE: + level = Z_NO_COMPRESSION; + break; + case OPC_COMPRESSION_NORMAL: + level = Z_DEFAULT_COMPRESSION; + break; + case OPC_COMPRESSION_MAXIMUM: + level = Z_BEST_COMPRESSION; + break; + case OPC_COMPRESSION_FAST: + level = 2; + break; + case OPC_COMPRESSION_SUPERFAST: + level = Z_BEST_SPEED; + break; + default: + WARN("Unsupported compression options %d.\n", options); + level = Z_DEFAULT_COMPRESSION; + } + + memset(&z_str, 0, sizeof(z_str)); + deflateInit2(&z_str, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); + + do + { + int ret; + + if (FAILED(hr = IStream_Read(content, archive->input_buffer, sizeof(archive->input_buffer), &num_read))) + { + archive->write_result = hr; + break; + } + + z_str.avail_in = num_read; + z_str.next_in = archive->input_buffer; + data_desc->crc32 = RtlComputeCrc32(data_desc->crc32, archive->input_buffer, num_read); + + flush = sizeof(archive->input_buffer) > num_read ? Z_FINISH : Z_NO_FLUSH; + + do + { + ULONG have; + + z_str.avail_out = sizeof(archive->output_buffer); + z_str.next_out = archive->output_buffer; + + if ((ret = deflate(&z_str, flush))) + WARN("Failed to deflate, ret %d.\n", ret); + have = sizeof(archive->output_buffer) - z_str.avail_out; + compress_write(archive, archive->output_buffer, have); + } while (z_str.avail_out == 0); + } while (flush != Z_FINISH); + + deflateEnd(&z_str); + + data_desc->compressed_size = z_str.total_out; + data_desc->uncompressed_size = z_str.total_in; +} + +HRESULT compress_add_file(struct zip_archive *archive, const WCHAR *path, + IStream *content, OPC_COMPRESSION_OPTIONS options) +{ + struct central_directory_header *entry; + struct local_file_header local_header; + struct data_descriptor data_desc; + DWORD local_header_pos; + char *name; + DWORD len; + + len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL); + if (!(name = heap_alloc(len))) + return E_OUTOFMEMORY; + WideCharToMultiByte(CP_ACP, 0, path, -1, name, len, NULL, NULL); + + /* Local header */ + local_header.signature = LOCAL_HEADER_SIGNATURE; + local_header.version = VERSION; + local_header.flags = USE_DATA_DESCRIPTOR; + local_header.method = 8; /* Z_DEFLATED */ + local_header.mtime = archive->mtime; + local_header.crc32 = 0; + local_header.compressed_size = 0; + local_header.uncompressed_size = 0; + local_header.name_length = len - 1; + local_header.extra_length = 0; + + local_header_pos = archive->position; + + compress_write(archive, &local_header, sizeof(local_header)); + compress_write(archive, name, local_header.name_length); + + /* Content */ + compress_write_content(archive, content, options, &data_desc); + + /* Data descriptor */ + data_desc.signature = DATA_DESCRIPTOR_SIGNATURE; + compress_write(archive, &data_desc, sizeof(data_desc)); + + if (FAILED(archive->write_result)) + return archive->write_result; + + /* Set directory entry */ + if (!(entry = heap_alloc_zero(sizeof(*entry) + local_header.name_length))) + { + heap_free(name); + return E_OUTOFMEMORY; + } + + entry->signature = CENTRAL_DIR_SIGNATURE; + entry->version = local_header.version; + entry->min_version = local_header.version; + entry->flags = local_header.flags; + entry->method = local_header.method; + entry->mtime = local_header.mtime; + entry->crc32 = data_desc.crc32; + entry->compressed_size = data_desc.compressed_size; + entry->uncompressed_size = data_desc.uncompressed_size; + entry->name_length = local_header.name_length; + entry->local_file_offset = local_header_pos; + memcpy(entry + 1, name, entry->name_length); + heap_free(name); + + if (!opc_array_reserve((void **)&archive->files, &archive->file_size, archive->file_count + 1, + sizeof(*archive->files))) + { + heap_free(entry); + return E_OUTOFMEMORY; + } + + archive->files[archive->file_count++] = entry; + + return S_OK; +} diff --git a/wrappers/new-dlls/opcservices/deflate.c b/wrappers/new-dlls/opcservices/deflate.c new file mode 100644 index 00000000000..681f187ecda --- /dev/null +++ b/wrappers/new-dlls/opcservices/deflate.c @@ -0,0 +1,2974 @@ +/* deflate.c -- compress data using the deflation algorithm + * + * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * Jean-loup Gailly Mark Adler + * jloup@gzip.org madler@alumni.caltech.edu + */ + +#include +#include +#include +#include "zlib.h" + +#define DEF_MEM_LEVEL 8 +#define DEF_WBITS MAX_WBITS +#define zmemcpy memcpy +#define zmemzero(dest, len) memset(dest, 0, len) + +#define Assert(cond,msg) +#define Trace(x) +#define Tracev(x) +#define Tracevv(x) +#define Tracecv(c,x) + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +/* Reverse the bytes in a 32-bit value */ +#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +static const char * const z_errmsg[10] = { + (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */ + (z_const char *)"stream end", /* Z_STREAM_END 1 */ + (z_const char *)"", /* Z_OK 0 */ + (z_const char *)"file error", /* Z_ERRNO (-1) */ + (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */ + (z_const char *)"data error", /* Z_DATA_ERROR (-3) */ + (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */ + (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */ + (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */ + (z_const char *)"" +}; + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + +#define BASE 65521U /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +#define MOD(a) a %= BASE +#define MOD28(a) a %= BASE +#define MOD63(a) a %= BASE + +static uLong adler32( uLong adler, const Bytef *buf, uInt len ) +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD28(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define Buf_size 16 +/* size of bit buffer in bi_buf */ + +#define INIT_STATE 42 /* zlib header -> BUSY_STATE */ +#ifdef GZIP +# define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */ +#endif +#define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */ +#define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */ +#define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */ +#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */ +#define BUSY_STATE 113 /* deflate -> FINISH_STATE */ +#define FINISH_STATE 666 /* stream complete */ +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + const static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + ulg pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + ulg gzindex; /* where in extra, name, or comment */ + Byte method; /* can only be DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to suppress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + uInt insert; /* bytes at end of window left to insert */ + +#ifdef ZLIB_DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + ulg high_water; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + +#define WIN_INIT MAX_MATCH +/* Number of bytes after end of data in window to initialize in order to avoid + memory checker errors from longest match routines */ + + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +static const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +static const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +static const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +static const uch bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ + +static const ct_data static_ltree[L_CODES+2] = { +{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, +{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, +{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, +{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, +{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, +{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, +{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, +{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, +{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, +{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, +{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, +{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, +{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, +{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, +{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, +{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, +{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, +{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, +{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, +{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, +{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, +{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, +{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, +{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, +{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, +{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, +{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, +{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, +{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, +{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, +{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, +{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, +{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, +{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, +{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, +{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, +{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, +{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, +{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, +{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, +{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, +{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, +{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, +{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, +{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, +{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, +{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, +{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, +{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, +{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, +{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, +{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, +{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, +{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, +{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, +{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, +{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, +{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} +}; + +static const ct_data static_dtree[D_CODES] = { +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} +}; + +static const uch _dist_code[DIST_CODE_LEN] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 +}; + +static const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 +}; + +static const int base_length[LENGTH_CODES] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, +64, 80, 96, 112, 128, 160, 192, 224, 0 +}; + +static const int base_dist[D_CODES] = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 +}; + + +struct static_tree_desc_s { + const ct_data *static_tree; /* static tree or NULL */ + const intf *extra_bits; /* extra bits for each code or NULL */ + int extra_base; /* base index for extra_bits */ + int elems; /* max number of elements in the tree */ + int max_length; /* max bit length for the codes */ +}; + +static const static_tree_desc static_l_desc = +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; + +static const static_tree_desc static_d_desc = +{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; + +static const static_tree_desc static_bl_desc = +{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; + +#define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) + /* Send a code of the given tree. c and tree must not have side effects */ + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} + +#define send_bits(s, value, length) \ +{ int len = length;\ + if (s->bi_valid > (int)Buf_size - len) {\ + int val = (int)value;\ + s->bi_buf |= (ush)val << s->bi_valid;\ + put_short(s, s->bi_buf);\ + s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ + s->bi_valid += len - Buf_size;\ + } else {\ + s->bi_buf |= (ush)(value) << s->bi_valid;\ + s->bi_valid += len;\ + }\ +} + + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +static void compress_block( deflate_state *s, const ct_data *ltree, const ct_data *dtree ) +{ + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned lx = 0; /* running index in l_buf */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->last_lit != 0) do { + dist = s->d_buf[lx]; + lc = s->l_buf[lx++]; + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= (unsigned)base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + "pendingBuf overflow"); + + } while (lx < s->last_lit); + + send_code(s, END_BLOCK, ltree); +} + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +static int detect_data_type( deflate_state *s ) +{ + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + unsigned long black_mask = 0xf3ffc07fUL; + int n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>= 1) + if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + return Z_BINARY; + + /* Check for textual ("white-listed") bytes. */ + if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 + || s->dyn_ltree[13].Freq != 0) + return Z_TEXT; + for (n = 32; n < LITERALS; n++) + if (s->dyn_ltree[n].Freq != 0) + return Z_TEXT; + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +static unsigned bi_reverse( unsigned code, int len ) +{ + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +static void bi_flush( deflate_state *s ) +{ + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +static void bi_windup( deflate_state *s ) +{ + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef ZLIB_DEBUG + s->bits_sent = (s->bits_sent+7) & ~7; +#endif +} + +/* =========================================================================== + * Initialize a new block. + */ +static void init_block( deflate_state *s ) +{ + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->last_lit = s->matches = 0; +} + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +static void _tr_init( deflate_state *s ) +{ + s->l_desc.dyn_tree = s->dyn_ltree; + s->l_desc.stat_desc = &static_l_desc; + + s->d_desc.dyn_tree = s->dyn_dtree; + s->d_desc.stat_desc = &static_d_desc; + + s->bl_desc.dyn_tree = s->bl_tree; + s->bl_desc.stat_desc = &static_bl_desc; + + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef ZLIB_DEBUG + s->compressed_len = 0L; + s->bits_sent = 0L; +#endif + + /* Initialize the first block of the first file: */ + init_block(s); +} + +#define SMALLEST 1 +/* Index within the heap array of least frequent node in the Huffman tree */ + + +/* =========================================================================== + * Remove the smallest element from the heap and recreate the heap with + * one less element. Updates heap and heap_len. + */ +#define pqremove(s, tree, top) \ +{\ + top = s->heap[SMALLEST]; \ + s->heap[SMALLEST] = s->heap[s->heap_len--]; \ + pqdownheap(s, tree, SMALLEST); \ +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +#define smaller(tree, n, m, depth) \ + (tree[n].Freq < tree[m].Freq || \ + (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +static void pqdownheap( deflate_state *s, ct_data *tree, int k ) +{ + int v = s->heap[k]; + int j = k << 1; /* left son of k */ + while (j <= s->heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s->heap_len && + smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s->heap[j], s->depth)) break; + + /* Exchange v with the smallest son */ + s->heap[k] = s->heap[j]; k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s->heap[k] = v; +} + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +static void gen_bitlen( deflate_state *s, tree_desc *desc ) +{ + ct_data *tree = desc->dyn_tree; + int max_code = desc->max_code; + const ct_data *stree = desc->stat_desc->static_tree; + const intf *extra = desc->stat_desc->extra_bits; + int base = desc->stat_desc->extra_base; + int max_length = desc->stat_desc->max_length; + int h; /* heap index */ + int n, m; /* iterate over the tree elements */ + int bits; /* bit length */ + int xbits; /* extra bits */ + ush f; /* frequency */ + int overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ + + for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + n = s->heap[h]; + bits = tree[tree[n].Dad].Len + 1; + if (bits > max_length) bits = max_length, overflow++; + tree[n].Len = (ush)bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) continue; /* not a leaf node */ + + s->bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n].Freq; + s->opt_len += (ulg)f * (unsigned)(bits + xbits); + if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); + } + if (overflow == 0) return; + + Tracev((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (s->bl_count[bits] == 0) bits--; + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits != 0; bits--) { + n = s->bl_count[bits]; + while (n != 0) { + m = s->heap[--h]; + if (m > max_code) continue; + if ((unsigned) tree[m].Len != (unsigned) bits) { + Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq; + tree[m].Len = (ush)bits; + } + n--; + } + } +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +static void gen_codes( ct_data *tree, int max_code, ushf *bl_count ) +{ + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + unsigned code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + code = (code + bl_count[bits-1]) << 1; + next_code[bits] = (ush)code; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; + const ct_data *stree = desc->stat_desc->static_tree; + int elems = desc->stat_desc->elems; + int n, m; /* iterate over heap elements */ + int max_code = -1; /* largest code with non zero frequency */ + int node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s->heap_len = 0, s->heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n].Freq != 0) { + s->heap[++(s->heap_len)] = max_code = n; + s->depth[n] = 0; + } else { + tree[n].Len = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s->heap_len < 2) { + node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); + tree[node].Freq = 1; + s->depth[node] = 0; + s->opt_len--; if (stree) s->static_len -= stree[node].Len; + /* node is 0 or 1 so it does not have extra bits */ + } + desc->max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + pqremove(s, tree, n); /* n = node of least frequency */ + m = s->heap[SMALLEST]; /* m = node of next least frequency */ + + s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ + s->heap[--(s->heap_max)] = m; + + /* Create a new node father of n and m */ + tree[node].Freq = tree[n].Freq + tree[m].Freq; + s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? + s->depth[n] : s->depth[m]) + 1); + tree[n].Dad = tree[m].Dad = (ush)node; +#ifdef DUMP_BL_TREE + if (tree == s->bl_tree) { + fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", + node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); + } +#endif + /* and insert the new node in the heap */ + s->heap[SMALLEST] = node++; + pqdownheap(s, tree, SMALLEST); + + } while (s->heap_len >= 2); + + s->heap[--(s->heap_max)] = s->heap[SMALLEST]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, (tree_desc *)desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes ((ct_data *)tree, max_code, s->bl_count); +} + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +static void scan_tree( deflate_state *s, ct_data *tree, int max_code ) +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + if (nextlen == 0) max_count = 138, min_count = 3; + tree[max_code+1].Len = (ush)0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + s->bl_tree[curlen].Freq += count; + } else if (curlen != 0) { + if (curlen != prevlen) s->bl_tree[curlen].Freq++; + s->bl_tree[REP_3_6].Freq++; + } else if (count <= 10) { + s->bl_tree[REPZ_3_10].Freq++; + } else { + s->bl_tree[REPZ_11_138].Freq++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +static void send_tree( deflate_state *s, ct_data *tree, int max_code ) +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen == 0) max_count = 138, min_count = 3; + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + do { send_code(s, curlen, s->bl_tree); } while (--count != 0); + + } else if (curlen != 0) { + if (curlen != prevlen) { + send_code(s, curlen, s->bl_tree); count--; + } + Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + + } else { + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +static int build_bl_tree( deflate_state *s ) +{ + int max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); + scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, (tree_desc *)(&(s->bl_desc))); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; + } + /* Update opt_len to include the bit length tree and counts */ + s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; + Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + s->opt_len, s->static_len)); + + return max_blindex; +} + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +static void send_all_trees( deflate_state *s, int lcodes, int dcodes, int blcodes ) +{ + int rank; /* index in bl_order */ + + Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + "too many codes"); + Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes-1, 5); + send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); + } + Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + +/* =========================================================================== + * Send a stored block + */ +static void _tr_stored_block( deflate_state *s, charf *buf, ulg stored_len, int last ) +{ + send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ + bi_windup(s); /* align on byte boundary */ + put_short(s, (ush)stored_len); + put_short(s, (ush)~stored_len); + zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); + s->pending += stored_len; +#ifdef ZLIB_DEBUG + s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; + s->compressed_len += (stored_len + 4) << 3; + s->bits_sent += 2*16; + s->bits_sent += stored_len<<3; +#endif +} + +/* =========================================================================== + * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) + */ +static void _tr_flush_bits( deflate_state *s ) +{ + bi_flush(s); +} + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +static void _tr_align( deflate_state *s ) +{ + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef ZLIB_DEBUG + s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ +#endif + bi_flush(s); +} + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and write out the encoded block. + */ +static void _tr_flush_block( deflate_state *s, charf *buf, ulg stored_len, int last ) +{ + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + int max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s->level > 0) { + + /* Check if the file is binary or text */ + if (s->strm->data_type == Z_UNKNOWN) + s->strm->data_type = detect_data_type(s); + + /* Construct the literal and distance trees */ + build_tree(s, (tree_desc *)(&(s->l_desc))); + Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + + build_tree(s, (tree_desc *)(&(s->d_desc))); + Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s->opt_len+3+7)>>3; + static_lenb = (s->static_len+3+7)>>3; + + Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + s->last_lit)); + + if (static_lenb <= opt_lenb) opt_lenb = static_lenb; + + } else { + Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + +#ifdef FORCE_STORED + if (buf != (char*)0) { /* force stored block */ +#else + if (stored_len+4 <= opt_lenb && buf != (char*)0) { + /* 4: two words for the lengths */ +#endif + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + +#ifdef FORCE_STATIC + } else if (static_lenb >= 0) { /* force static trees */ +#else + } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { +#endif + send_bits(s, (STATIC_TREES<<1)+last, 3); + compress_block(s, (const ct_data *)static_ltree, + (const ct_data *)static_dtree); +#ifdef ZLIB_DEBUG + s->compressed_len += 3 + s->static_len; +#endif + } else { + send_bits(s, (DYN_TREES<<1)+last, 3); + send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, + max_blindex+1); + compress_block(s, (const ct_data *)s->dyn_ltree, + (const ct_data *)s->dyn_dtree); +#ifdef ZLIB_DEBUG + s->compressed_len += 3 + s->opt_len; +#endif + } + Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); +#ifdef ZLIB_DEBUG + s->compressed_len += 7; /* align on byte boundary */ +#endif + } + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + s->compressed_len-7*last)); +} + +const char deflate_copyright[] = + " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* =========================================================================== + * Function prototypes. + */ +typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ +} block_state; + +typedef block_state (*compress_func)(deflate_state *s, int flush); +/* Compression function. Returns the block state after the call. */ + +static int deflateReset(z_streamp strm); +static block_state deflate_stored(deflate_state *s, int flush); +static block_state deflate_fast(deflate_state *s, int flush); +static block_state deflate_slow(deflate_state *s, int flush); +static block_state deflate_rle(deflate_state *s, int flush); +static block_state deflate_huff(deflate_state *s, int flush); +static void lm_init(deflate_state *s); + +/* =========================================================================== + * Local data + */ + +#define NIL 0 +/* Tail of hash chains */ + +#ifndef TOO_FAR +# define TOO_FAR 4096 +#endif +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +typedef struct config_s { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; + compress_func func; +} config; + +static const config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8, deflate_fast}, +/* 3 */ {4, 6, 32, 32, deflate_fast}, + +/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32, deflate_slow}, +/* 6 */ {8, 16, 128, 128, deflate_slow}, +/* 7 */ {8, 32, 128, 256, deflate_slow}, +/* 8 */ {32, 128, 258, 1024, deflate_slow}, +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ +#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to UPDATE_HASH are made with consecutive input + * characters, so that a running hash key can be computed from the previous + * key instead of complete recalculation each time. + */ +#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) + + +/* =========================================================================== + * Insert string str in the dictionary and set match_head to the previous head + * of the hash chain (the most recent string with same hash key). Return + * the previous length of the hash chain. + * If this file is compiled with -DFASTEST, the compression level is forced + * to 1, and no hash chains are maintained. + * IN assertion: all calls to INSERT_STRING are made with consecutive input + * characters and the first MIN_MATCH bytes of str are valid (except for + * the last MIN_MATCH-1 bytes of the input file). + */ +#ifdef FASTEST +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#else +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#endif + +/* =========================================================================== + * Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ +#define CLEAR_HASH(s) \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + +/* =========================================================================== + * Slide the hash table when sliding the window down (could be avoided with 32 + * bit values at the expense of memory usage). We slide even when level == 0 to + * keep the hash table consistent if we switch back to level > 0 later. + */ +static void slide_hash( deflate_state *s ) +{ + unsigned n, m; + Posf *p; + uInt wsize = s->w_size; + + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + } while (--n); + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif +} + +/* ========================================================================= */ +int deflateInit( z_streamp strm, int level ) +{ + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + /* To do: ignore strm->next_in if we use it as window */ +} + +/* ========================================================================= */ +int deflateInit2( z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy ) +{ + deflate_state *s; + int wrap = 1; + ushf *overlay; + /* We overlay pending_buf and d_buf+l_buf. This works since the average + * output size for (length,distance) codes is <= 24 bits. + */ + + strm->msg = Z_NULL; +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } +#ifdef GZIP + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } +#endif + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) { + return Z_STREAM_ERROR; + } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ + s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == Z_NULL) return Z_MEM_ERROR; + strm->state = (struct internal_state FAR *)s; + s->strm = strm; + s->status = INIT_STATE; /* to pass state test in deflateReset() */ + + s->wrap = wrap; + s->gzhead = Z_NULL; + s->w_bits = (uInt)windowBits; + s->w_size = 1 << s->w_bits; + s->w_mask = s->w_size - 1; + + s->hash_bits = (uInt)memLevel + 7; + s->hash_size = 1 << s->hash_bits; + s->hash_mask = s->hash_size - 1; + s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + + s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + + s->high_water = 0; /* nothing written to s->window yet */ + + s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + s->pending_buf = (uchf *) overlay; + s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + + if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || + s->pending_buf == Z_NULL) { + s->status = FINISH_STATE; + strm->msg = ERR_MSG(Z_MEM_ERROR); + deflateEnd (strm); + return Z_MEM_ERROR; + } + s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + + s->level = level; + s->strategy = strategy; + s->method = (Byte)method; + + return deflateReset(strm); +} + +/* ========================================================================= + * Check for a valid deflate stream state. Return 0 if ok, 1 if not. + */ +static int deflateStateCheck( z_streamp strm ) +{ + deflate_state *s; + if (strm == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) + return 1; + s = strm->state; + if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE && +#ifdef GZIP + s->status != GZIP_STATE && +#endif + s->status != EXTRA_STATE && + s->status != NAME_STATE && + s->status != COMMENT_STATE && + s->status != HCRC_STATE && + s->status != BUSY_STATE && + s->status != FINISH_STATE)) + return 1; + return 0; +} + +/* ========================================================================= */ +static int deflateResetKeep( z_streamp strm ) +{ + deflate_state *s; + + if (deflateStateCheck(strm)) { + return Z_STREAM_ERROR; + } + + strm->total_in = strm->total_out = 0; + strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = Z_UNKNOWN; + + s = (deflate_state *)strm->state; + s->pending = 0; + s->pending_out = s->pending_buf; + + if (s->wrap < 0) { + s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ + } + s->status = +#ifdef GZIP + s->wrap == 2 ? GZIP_STATE : +#endif + s->wrap ? INIT_STATE : BUSY_STATE; + strm->adler = +#ifdef GZIP + s->wrap == 2 ? crc32(0L, Z_NULL, 0) : +#endif + adler32(0L, Z_NULL, 0); + s->last_flush = Z_NO_FLUSH; + + _tr_init(s); + + return Z_OK; +} + +/* ========================================================================= */ +static int deflateReset( z_streamp strm ) +{ + int ret; + + ret = deflateResetKeep(strm); + if (ret == Z_OK) + lm_init(strm->state); + return ret; +} + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +static void putShortMSB( deflate_state *s, uInt b ) +{ + put_byte(s, (Byte)(b >> 8)); + put_byte(s, (Byte)(b & 0xff)); +} + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output, except for + * some deflate_stored() output, goes through this function so some + * applications may wish to modify it to avoid allocating a large + * strm->next_out buffer and copying into it. (See also read_buf()). + */ +static void flush_pending( z_streamp strm ) +{ + unsigned len; + deflate_state *s = strm->state; + + _tr_flush_bits(s); + len = s->pending; + if (len > strm->avail_out) len = strm->avail_out; + if (len == 0) return; + + zmemcpy(strm->next_out, s->pending_out, len); + strm->next_out += len; + s->pending_out += len; + strm->total_out += len; + strm->avail_out -= len; + s->pending -= len; + if (s->pending == 0) { + s->pending_out = s->pending_buf; + } +} + +/* =========================================================================== + * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1]. + */ +#define HCRC_UPDATE(beg) \ + do { \ + if (s->gzhead->hcrc && s->pending > (beg)) \ + strm->adler = crc32(strm->adler, s->pending_buf + (beg), \ + s->pending - (beg)); \ + } while (0) + +/* ========================================================================= */ +int deflate( z_streamp strm, int flush ) +{ + int old_flush; /* value of flush param for previous deflate call */ + deflate_state *s; + + if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) { + return Z_STREAM_ERROR; + } + s = strm->state; + + if (strm->next_out == Z_NULL || + (strm->avail_in != 0 && strm->next_in == Z_NULL) || + (s->status == FINISH_STATE && flush != Z_FINISH)) { + ERR_RETURN(strm, Z_STREAM_ERROR); + } + if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + + old_flush = s->last_flush; + s->last_flush = flush; + + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* Write the header */ + if (s->status == INIT_STATE) { + /* zlib header */ + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; + else + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } +#ifdef GZIP + if (s->status == GZIP_STATE) { + /* gzip header */ + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == Z_NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s->status = BUSY_STATE; + + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != Z_NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); + } + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; + } + } + if (s->status == EXTRA_STATE) { + if (s->gzhead->extra != Z_NULL) { + ulg beg = s->pending; /* start of bytes to update crc */ + uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex; + while (s->pending + left > s->pending_buf_size) { + uInt copy = s->pending_buf_size - s->pending; + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, copy); + s->pending = s->pending_buf_size; + HCRC_UPDATE(beg); + s->gzindex += copy; + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + beg = 0; + left -= copy; + } + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, left); + s->pending += left; + HCRC_UPDATE(beg); + s->gzindex = 0; + } + s->status = NAME_STATE; + } + if (s->status == NAME_STATE) { + if (s->gzhead->name != Z_NULL) { + ulg beg = s->pending; /* start of bytes to update crc */ + int val; + do { + if (s->pending == s->pending_buf_size) { + HCRC_UPDATE(beg); + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + beg = 0; + } + val = s->gzhead->name[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + HCRC_UPDATE(beg); + s->gzindex = 0; + } + s->status = COMMENT_STATE; + } + if (s->status == COMMENT_STATE) { + if (s->gzhead->comment != Z_NULL) { + ulg beg = s->pending; /* start of bytes to update crc */ + int val; + do { + if (s->pending == s->pending_buf_size) { + HCRC_UPDATE(beg); + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + beg = 0; + } + val = s->gzhead->comment[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + HCRC_UPDATE(beg); + } + s->status = HCRC_STATE; + } + if (s->status == HCRC_STATE) { + if (s->gzhead->hcrc) { + if (s->pending + 2 > s->pending_buf_size) { + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); + } + s->status = BUSY_STATE; + + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } +#endif + + /* Start a new block or continue the current one. + */ + if (strm->avail_in != 0 || s->lookahead != 0 || + (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + block_state bstate; + + bstate = s->level == 0 ? deflate_stored(s, flush) : + s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : + s->strategy == Z_RLE ? deflate_rle(s, flush) : + (*(configuration_table[s->level].func))(s, flush); + + if (bstate == finish_started || bstate == finish_done) { + s->status = FINISH_STATE; + } + if (bstate == need_more || bstate == finish_started) { + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate == block_done) { + if (flush == Z_PARTIAL_FLUSH) { + _tr_align(s); + } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + _tr_stored_block(s, (char*)0, 0L, 0); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush == Z_FULL_FLUSH) { + CLEAR_HASH(s); /* forget history */ + if (s->lookahead == 0) { + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + } + } + flush_pending(strm); + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + + if (flush != Z_FINISH) return Z_OK; + if (s->wrap <= 0) return Z_STREAM_END; + + /* Write the trailer */ +#ifdef GZIP + if (s->wrap == 2) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); + put_byte(s, (Byte)(strm->total_in & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); + } + else +#endif + { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ + return s->pending != 0 ? Z_OK : Z_STREAM_END; +} + +/* ========================================================================= */ +int deflateEnd( z_streamp strm ) +{ + int status; + + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; + + status = strm->state->status; + + /* Deallocate in reverse order of allocations: */ + TRY_FREE(strm, strm->state->pending_buf); + TRY_FREE(strm, strm->state->head); + TRY_FREE(strm, strm->state->prev); + TRY_FREE(strm, strm->state->window); + + ZFREE(strm, strm->state); + strm->state = Z_NULL; + + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; +} + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +static unsigned read_buf( z_streamp strm, Bytef *buf, unsigned size ) +{ + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + zmemcpy(buf, strm->next_in, len); + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, buf, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, buf, len); + } +#endif + strm->next_in += len; + strm->total_in += len; + + return len; +} + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +static void lm_init( deflate_state *s ) +{ + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->insert = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +} + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +static uInt longest_match( deflate_state *s, IPos cur_match ) +{ + unsigned chain_length = s->max_chain_length;/* max hash chain length */ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + int best_len = (int)s->prev_length; /* best match length so far */ + int nice_match = s->nice_match; /* stop if match long enough */ + IPos limit = s->strstart > (IPos)MAX_DIST(s) ? + s->strstart - (IPos)MAX_DIST(s) : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + Posf *prev = s->prev; + uInt wmask = s->w_mask; + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + register ush scan_start = *(ushf*)scan; + register ush scan_end = *(ushf*)(scan+best_len-1); +#else + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end = scan[best_len]; +#endif + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s->prev_length >= s->good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + Assert(cur_match < s->strstart, "no future"); + match = s->window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ushf*)(match+best_len-1) != scan_end || + *(ushf*)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + Assert(scan[2] == match[2], "scan[2]?"); + scan++, match++; + do { + } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + s->match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ushf*)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & wmask]) > limit + && --chain_length != 0); + + if ((uInt)best_len <= s->lookahead) return (uInt)best_len; + return s->lookahead; +} + +#define check_match(s, start, match, length) + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +static void fill_window( deflate_state *s ) +{ + unsigned n; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize+MAX_DIST(s)) { + + zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + slide_hash(s); + more += wsize; + } + if (s->strm->avail_in == 0) break; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ + if (s->high_water < s->window_size) { + ulg curr = s->strstart + (ulg)(s->lookahead); + ulg init; + + if (s->high_water < curr) { + /* Previous high water mark below current data -- zero WIN_INIT + * bytes or up to end of window, whichever is less. + */ + init = s->window_size - curr; + if (init > WIN_INIT) + init = WIN_INIT; + zmemzero(s->window + curr, (unsigned)init); + s->high_water = curr + init; + } + else if (s->high_water < (ulg)curr + WIN_INIT) { + /* High water mark at or above current data, but below current data + * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up + * to end of window, whichever is less. + */ + init = (ulg)curr + WIN_INIT - s->high_water; + if (init > s->window_size - s->high_water) + init = s->window_size - s->high_water; + zmemzero(s->window + s->high_water, (unsigned)init); + s->high_water += init; + } + } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK_ONLY(s, last) { \ + _tr_flush_block(s, (s->block_start >= 0L ? \ + (charf *)&s->window[(unsigned)s->block_start] : \ + (charf *)Z_NULL), \ + (ulg)((long)s->strstart - s->block_start), \ + (last)); \ + s->block_start = s->strstart; \ + flush_pending(s->strm); \ + Tracev((stderr,"[FLUSH]")); \ +} + +/* Same but force premature exit if necessary. */ +#define FLUSH_BLOCK(s, last) { \ + FLUSH_BLOCK_ONLY(s, last); \ + if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ +} + +/* Maximum stored block length in deflate format (not including header). */ +#define MAX_STORED 65535 + +/* Minimum of a and b. */ +#define MIN(a, b) ((a) > (b) ? (b) : (a)) + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * + * In case deflateParams() is used to later switch to a non-zero compression + * level, s->matches (otherwise unused when storing) keeps track of the number + * of hash table slides to perform. If s->matches is 1, then one hash table + * slide will be done when switching. If s->matches is 2, the maximum value + * allowed here, then the hash table will be cleared, since two or more slides + * is the same as a clear. + * + * deflate_stored() is written to minimize the number of times an input byte is + * copied. It is most efficient with large input and output buffers, which + * maximizes the opportunites to have a single copy from next_in to next_out. + */ +static block_state deflate_stored( deflate_state *s, int flush ) +{ + /* Smallest worthy block size when not flushing or finishing. By default + * this is 32K. This can be as small as 507 bytes for memLevel == 1. For + * large input and output buffers, the stored block size will be larger. + */ + unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size); + + /* Copy as many min_block or larger stored blocks directly to next_out as + * possible. If flushing, copy the remaining available input to next_out as + * stored blocks, if there is enough space. + */ + unsigned len, left, have, last = 0; + unsigned used = s->strm->avail_in; + do { + /* Set len to the maximum size block that we can copy directly with the + * available input data and output space. Set left to how much of that + * would be copied from what's left in the window. + */ + len = MAX_STORED; /* maximum deflate stored block length */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + if (s->strm->avail_out < have) /* need room for header */ + break; + /* maximum stored block length that will fit in avail_out: */ + have = s->strm->avail_out - have; + left = s->strstart - s->block_start; /* bytes left in window */ + if (len > (ulg)left + s->strm->avail_in) + len = left + s->strm->avail_in; /* limit len to the input */ + if (len > have) + len = have; /* limit len to the output */ + + /* If the stored block would be less than min_block in length, or if + * unable to copy all of the available input when flushing, then try + * copying to the window and the pending buffer instead. Also don't + * write an empty block when flushing -- deflate() does that. + */ + if (len < min_block && ((len == 0 && flush != Z_FINISH) || + flush == Z_NO_FLUSH || + len != left + s->strm->avail_in)) + break; + + /* Make a dummy stored block in pending to get the header bytes, + * including any pending bits. This also updates the debugging counts. + */ + last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; + _tr_stored_block(s, (char *)0, 0L, last); + + /* Replace the lengths in the dummy stored block with len. */ + s->pending_buf[s->pending - 4] = len; + s->pending_buf[s->pending - 3] = len >> 8; + s->pending_buf[s->pending - 2] = ~len; + s->pending_buf[s->pending - 1] = ~len >> 8; + + /* Write the stored block header bytes. */ + flush_pending(s->strm); + +#ifdef ZLIB_DEBUG + /* Update debugging counts for the data about to be copied. */ + s->compressed_len += len << 3; + s->bits_sent += len << 3; +#endif + + /* Copy uncompressed bytes from the window to next_out. */ + if (left) { + if (left > len) + left = len; + zmemcpy(s->strm->next_out, s->window + s->block_start, left); + s->strm->next_out += left; + s->strm->avail_out -= left; + s->strm->total_out += left; + s->block_start += left; + len -= left; + } + + /* Copy uncompressed bytes directly from next_in to next_out, updating + * the check value. + */ + if (len) { + read_buf(s->strm, s->strm->next_out, len); + s->strm->next_out += len; + s->strm->avail_out -= len; + s->strm->total_out += len; + } + } while (last == 0); + + /* Update the sliding window with the last s->w_size bytes of the copied + * data, or append all of the copied data to the existing window if less + * than s->w_size bytes were copied. Also update the number of bytes to + * insert in the hash tables, in the event that deflateParams() switches to + * a non-zero compression level. + */ + used -= s->strm->avail_in; /* number of input bytes directly copied */ + if (used) { + /* If any input was used, then no unused input remains in the window, + * therefore s->block_start == s->strstart. + */ + if (used >= s->w_size) { /* supplant the previous history */ + s->matches = 2; /* clear hash */ + zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size); + s->strstart = s->w_size; + } + else { + if (s->window_size - s->strstart <= used) { + /* Slide the window down. */ + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + } + zmemcpy(s->window + s->strstart, s->strm->next_in - used, used); + s->strstart += used; + } + s->block_start = s->strstart; + s->insert += MIN(used, s->w_size - s->insert); + } + if (s->high_water < s->strstart) + s->high_water = s->strstart; + + /* If the last block was written to next_out, then done. */ + if (last) + return finish_done; + + /* If flushing and all input has been consumed, then done. */ + if (flush != Z_NO_FLUSH && flush != Z_FINISH && + s->strm->avail_in == 0 && (long)s->strstart == s->block_start) + return block_done; + + /* Fill the window with any remaining input. */ + have = s->window_size - s->strstart - 1; + if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { + /* Slide the window down. */ + s->block_start -= s->w_size; + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + have += s->w_size; /* more space now */ + } + if (have > s->strm->avail_in) + have = s->strm->avail_in; + if (have) { + read_buf(s->strm, s->window + s->strstart, have); + s->strstart += have; + } + if (s->high_water < s->strstart) + s->high_water = s->strstart; + + /* There was not enough avail_out to write a complete worthy or flushed + * stored block to next_out. Write a stored block to pending instead, if we + * have enough input for a worthy block, or if flushing and there is enough + * room for the remaining input as a stored block in the pending buffer. + */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + /* maximum stored block length that will fit in pending: */ + have = MIN(s->pending_buf_size - have, MAX_STORED); + min_block = MIN(have, s->w_size); + left = s->strstart - s->block_start; + if (left >= min_block || + ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH && + s->strm->avail_in == 0 && left <= have)) { + len = MIN(left, have); + last = flush == Z_FINISH && s->strm->avail_in == 0 && + len == left ? 1 : 0; + _tr_stored_block(s, (charf *)s->window + s->block_start, len, last); + s->block_start += len; + flush_pending(s->strm); + } + + /* We've done all we can with the available input and output. */ + return last ? finish_started : need_more; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +static block_state deflate_fast( deflate_state *s, int flush ) +{ + IPos hash_head; /* head of the hash chain */ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + } + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->match_start, s->match_length); + + _tr_tally_dist(s, s->strstart - s->match_start, + s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +#ifndef FASTEST + if (s->match_length <= s->max_insert_length && + s->lookahead >= MIN_MATCH) { + s->match_length--; /* string at strstart already in table */ + do { + s->strstart++; + INSERT_STRING(s, s->strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s->match_length != 0); + s->strstart++; + } else +#endif + { + s->strstart += s->match_length; + s->match_length = 0; + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +static block_state deflate_slow( deflate_state *s, int flush ) +{ + IPos hash_head; /* head of hash chain */ + int bflush; /* set if current block must be flushed */ + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + */ + s->prev_length = s->match_length, s->prev_match = s->match_start; + s->match_length = MIN_MATCH-1; + + if (hash_head != NIL && s->prev_length < s->max_lazy_match && + s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + + if (s->match_length <= 5 && (s->strategy == Z_FILTERED +#if TOO_FAR <= 32767 + || (s->match_length == MIN_MATCH && + s->strstart - s->match_start > TOO_FAR) +#endif + )) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s->match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { + uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + check_match(s, s->strstart-1, s->prev_match, s->prev_length); + + _tr_tally_dist(s, s->strstart -1 - s->prev_match, + s->prev_length - MIN_MATCH, bflush); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s->lookahead -= s->prev_length-1; + s->prev_length -= 2; + do { + if (++s->strstart <= max_insert) { + INSERT_STRING(s, s->strstart, hash_head); + } + } while (--s->prev_length != 0); + s->match_available = 0; + s->match_length = MIN_MATCH-1; + s->strstart++; + + if (bflush) FLUSH_BLOCK(s, 0); + + } else if (s->match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + if (bflush) { + FLUSH_BLOCK_ONLY(s, 0); + } + s->strstart++; + s->lookahead--; + if (s->strm->avail_out == 0) return need_more; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s->match_available = 1; + s->strstart++; + s->lookahead--; + } + } + Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s->match_available) { + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + s->match_available = 0; + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +static block_state deflate_rle( deflate_state *s, int flush ) +{ + int bflush; /* set if current block must be flushed */ + uInt prev; /* byte at distance one to match */ + Bytef *scan, *strend; /* scan goes up to strend for length of run */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s->lookahead <= MAX_MATCH) { + fill_window(s); + if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s->match_length = 0; + if (s->lookahead >= MIN_MATCH && s->strstart > 0) { + scan = s->window + s->strstart - 1; + prev = *scan; + if (prev == *++scan && prev == *++scan && prev == *++scan) { + strend = s->window + s->strstart + MAX_MATCH; + do { + } while (prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + scan < strend); + s->match_length = MAX_MATCH - (uInt)(strend - scan); + if (s->match_length > s->lookahead) + s->match_length = s->lookahead; + } + Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->strstart - 1, s->match_length); + + _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + s->strstart += s->match_length; + s->match_length = 0; + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +static block_state deflate_huff( deflate_state *s, int flush ) +{ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s->lookahead == 0) { + fill_window(s); + if (s->lookahead == 0) { + if (flush == Z_NO_FLUSH) + return need_more; + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s->match_length = 0; + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} diff --git a/wrappers/new-dlls/opcservices/factory.c b/wrappers/new-dlls/opcservices/factory.c new file mode 100644 index 00000000000..eb0455828f3 --- /dev/null +++ b/wrappers/new-dlls/opcservices/factory.c @@ -0,0 +1,483 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include "windef.h" +#include "winbase.h" + +#include "initguid.h" +#include "ole2.h" +#include "rpcproxy.h" +#include "msopc.h" +#include "xmllite.h" + +#include "wine/debug.h" + +#include "opc_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msopc); + +struct opc_filestream +{ + IStream IStream_iface; + LONG refcount; + + HANDLE hfile; +}; + +static inline struct opc_filestream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct opc_filestream, IStream_iface); +} + +static HRESULT WINAPI opc_filestream_QueryInterface(IStream *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IStream) || + IsEqualIID(iid, &IID_ISequentialStream) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IStream_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_filestream_AddRef(IStream *iface) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedIncrement(&stream->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_filestream_Release(IStream *iface) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedDecrement(&stream->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + CloseHandle(stream->hfile); + heap_free(stream); + } + + return refcount; +} + +static HRESULT WINAPI opc_filestream_Read(IStream *iface, void *buff, ULONG size, ULONG *num_read) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + DWORD read = 0; + + TRACE("iface %p, buff %p, size %u, num_read %p.\n", iface, buff, size, num_read); + + if (!num_read) + num_read = &read; + + *num_read = 0; + if (!ReadFile(stream->hfile, buff, size, num_read, NULL)) + { + WARN("Failed to read file, error %d.\n", GetLastError()); + return HRESULT_FROM_WIN32(GetLastError()); + } + + return *num_read == size ? S_OK : S_FALSE; +} + +static HRESULT WINAPI opc_filestream_Write(IStream *iface, const void *data, ULONG size, ULONG *num_written) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + DWORD written = 0; + + TRACE("iface %p, data %p, size %u, num_written %p.\n", iface, data, size, num_written); + + if (!num_written) + num_written = &written; + + *num_written = 0; + if (!WriteFile(stream->hfile, data, size, num_written, NULL)) + { + WARN("Failed to write to file, error %d.\n", GetLastError()); + return HRESULT_FROM_WIN32(GetLastError()); + } + + return S_OK; +} + +static HRESULT WINAPI opc_filestream_Seek(IStream *iface, LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER *newpos) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + + TRACE("iface %p, move %s, origin %d, newpos %p.\n", iface, wine_dbgstr_longlong(move.QuadPart), origin, newpos); + + if (!SetFilePointerEx(stream->hfile, move, (LARGE_INTEGER *)newpos, origin)) + return HRESULT_FROM_WIN32(GetLastError()); + + return S_OK; +} + +static HRESULT WINAPI opc_filestream_SetSize(IStream *iface, ULARGE_INTEGER size) +{ + FIXME("iface %p, size %s stub!\n", iface, wine_dbgstr_longlong(size.QuadPart)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_CopyTo(IStream *iface, IStream *dest, ULARGE_INTEGER size, + ULARGE_INTEGER *num_read, ULARGE_INTEGER *written) +{ + FIXME("iface %p, dest %p, size %s, num_read %p, written %p stub!\n", iface, dest, + wine_dbgstr_longlong(size.QuadPart), num_read, written); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_Commit(IStream *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_Revert(IStream *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_LockRegion(IStream *iface, ULARGE_INTEGER offset, + ULARGE_INTEGER size, DWORD lock_type) +{ + FIXME("iface %p, offset %s, size %s, lock_type %d stub!\n", iface, wine_dbgstr_longlong(offset.QuadPart), + wine_dbgstr_longlong(size.QuadPart), lock_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_UnlockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER size, + DWORD lock_type) +{ + FIXME("iface %p, offset %s, size %s, lock_type %d stub!\n", iface, wine_dbgstr_longlong(offset.QuadPart), + wine_dbgstr_longlong(size.QuadPart), lock_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_filestream_Stat(IStream *iface, STATSTG *statstg, DWORD flag) +{ + struct opc_filestream *stream = impl_from_IStream(iface); + BY_HANDLE_FILE_INFORMATION fi; + + TRACE("iface %p, statstg %p, flag %d.\n", iface, statstg, flag); + + if (!statstg) + return E_POINTER; + + memset(&fi, 0, sizeof(fi)); + GetFileInformationByHandle(stream->hfile, &fi); + + memset(statstg, 0, sizeof(*statstg)); + statstg->type = STGTY_STREAM; + statstg->cbSize.u.LowPart = fi.nFileSizeLow; + statstg->cbSize.u.HighPart = fi.nFileSizeHigh; + statstg->mtime = fi.ftLastWriteTime; + statstg->ctime = fi.ftCreationTime; + statstg->atime = fi.ftLastAccessTime; + + return S_OK; +} + +static HRESULT WINAPI opc_filestream_Clone(IStream *iface, IStream **result) +{ + FIXME("iface %p, result %p stub!\n", iface, result); + + return E_NOTIMPL; +} + +static const IStreamVtbl opc_filestream_vtbl = +{ + opc_filestream_QueryInterface, + opc_filestream_AddRef, + opc_filestream_Release, + opc_filestream_Read, + opc_filestream_Write, + opc_filestream_Seek, + opc_filestream_SetSize, + opc_filestream_CopyTo, + opc_filestream_Commit, + opc_filestream_Revert, + opc_filestream_LockRegion, + opc_filestream_UnlockRegion, + opc_filestream_Stat, + opc_filestream_Clone, +}; + +static HRESULT opc_filestream_create(const WCHAR *filename, OPC_STREAM_IO_MODE io_mode, SECURITY_ATTRIBUTES *sa, + DWORD flags, IStream **out) +{ + struct opc_filestream *stream; + DWORD access, creation; + + if (!filename || !out) + return E_POINTER; + + switch (io_mode) + { + case OPC_STREAM_IO_READ: + access = GENERIC_READ; + creation = OPEN_EXISTING; + break; + case OPC_STREAM_IO_WRITE: + access = GENERIC_WRITE; + creation = CREATE_ALWAYS; + break; + default: + return E_INVALIDARG; + } + + if (!(stream = heap_alloc_zero(sizeof(*stream)))) + return E_OUTOFMEMORY; + + stream->hfile = CreateFileW(filename, access, 0, sa, creation, flags, NULL); + if (stream->hfile == INVALID_HANDLE_VALUE) + { + HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); + heap_free(stream); + return hr; + } + + stream->IStream_iface.lpVtbl = &opc_filestream_vtbl; + stream->refcount = 1; + + *out = &stream->IStream_iface; + TRACE("Created file stream %p.\n", *out); + return S_OK; +} + +static HRESULT WINAPI opc_factory_QueryInterface(IOpcFactory *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcFactory) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcFactory_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_factory_AddRef(IOpcFactory *iface) +{ + return 2; +} + +static ULONG WINAPI opc_factory_Release(IOpcFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI opc_factory_CreatePackageRootUri(IOpcFactory *iface, IOpcUri **uri) +{ + TRACE("iface %p, uri %p.\n", iface, uri); + + if (!uri) + return E_POINTER; + + return opc_root_uri_create(uri); +} + +static HRESULT WINAPI opc_factory_CreatePartUri(IOpcFactory *iface, LPCWSTR uri, IOpcPartUri **out) +{ + IUri *part_uri, *root_uri, *combined; + HRESULT hr; + + TRACE("iface %p, uri %s, out %p.\n", iface, debugstr_w(uri), out); + + if (!out) + return E_POINTER; + + *out = NULL; + + if (FAILED(hr = CreateUri(uri, Uri_CREATE_ALLOW_RELATIVE, 0, &part_uri))) + { + WARN("Failed to create uri, hr %#x.\n", hr); + return hr; + } + + if (FAILED(hr = CreateUri(L"/", Uri_CREATE_ALLOW_RELATIVE, 0, &root_uri))) + { + WARN("Failed to create root uri, hr %#x.\n", hr); + IUri_Release(part_uri); + return hr; + } + + hr = CoInternetCombineIUri(root_uri, part_uri, 0, &combined, 0); + IUri_Release(root_uri); + IUri_Release(part_uri); + if (FAILED(hr)) + { + WARN("Failed to combine URIs, hr %#x.\n", hr); + return hr; + } + + hr = opc_part_uri_create(combined, NULL, out); + IUri_Release(combined); + return hr; +} + +static HRESULT WINAPI opc_factory_CreateStreamOnFile(IOpcFactory *iface, LPCWSTR filename, + OPC_STREAM_IO_MODE io_mode, SECURITY_ATTRIBUTES *sa, DWORD flags, IStream **stream) +{ + TRACE("iface %p, filename %s, io_mode %d, sa %p, flags %#x, stream %p.\n", iface, debugstr_w(filename), + io_mode, sa, flags, stream); + + return opc_filestream_create(filename, io_mode, sa, flags, stream); +} + +static HRESULT WINAPI opc_factory_CreatePackage(IOpcFactory *iface, IOpcPackage **package) +{ + TRACE("iface %p, package %p.\n", iface, package); + + return opc_package_create(iface, package); +} + +static HRESULT WINAPI opc_factory_ReadPackageFromStream(IOpcFactory *iface, IStream *stream, + OPC_READ_FLAGS flags, IOpcPackage **package) +{ + FIXME("iface %p, stream %p, flags %#x, package %p stub!\n", iface, stream, flags, package); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_WritePackageToStream(IOpcFactory *iface, IOpcPackage *package, OPC_WRITE_FLAGS flags, + IStream *stream) +{ + TRACE("iface %p, package %p, flags %#x, stream %p.\n", iface, package, flags, stream); + + if (!package || !stream) + return E_POINTER; + + return opc_package_write(package, flags, stream); +} + +static HRESULT WINAPI opc_factory_CreateDigitalSignatureManager(IOpcFactory *iface, IOpcPackage *package, + IOpcDigitalSignatureManager **signature_manager) +{ + FIXME("iface %p, package %p, signature_manager %p stub!\n", iface, package, signature_manager); + + return E_NOTIMPL; +} + +static const IOpcFactoryVtbl opc_factory_vtbl = +{ + opc_factory_QueryInterface, + opc_factory_AddRef, + opc_factory_Release, + opc_factory_CreatePackageRootUri, + opc_factory_CreatePartUri, + opc_factory_CreateStreamOnFile, + opc_factory_CreatePackage, + opc_factory_ReadPackageFromStream, + opc_factory_WritePackageToStream, + opc_factory_CreateDigitalSignatureManager, +}; + +static IOpcFactory opc_factory = { &opc_factory_vtbl }; + +static HRESULT WINAPI opc_class_factory_QueryInterface(IClassFactory *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IClassFactory) || + IsEqualGUID(iid, &IID_IUnknown)) + { + IClassFactory_AddRef(iface); + *out = iface; + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_class_factory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI opc_class_factory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI opc_class_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID iid, void **out) +{ + TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out); + + if (outer) + return CLASS_E_NOAGGREGATION; + + return IOpcFactory_QueryInterface(&opc_factory, iid, out); +} + +static HRESULT WINAPI opc_class_factory_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("iface %p, dolock %d stub!\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl opc_class_factory_vtbl = +{ + opc_class_factory_QueryInterface, + opc_class_factory_AddRef, + opc_class_factory_Release, + opc_class_factory_CreateInstance, + opc_class_factory_LockServer +}; + +static IClassFactory opc_class_factory = { &opc_class_factory_vtbl }; + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) +{ + TRACE("clsid %s, iid %s, out %p\n", debugstr_guid(clsid), debugstr_guid(iid), out); + + if (IsEqualCLSID(clsid, &CLSID_OpcFactory)) + return IClassFactory_QueryInterface(&opc_class_factory, iid, out); + + WARN("Unsupported class %s.\n", debugstr_guid(clsid)); + return E_NOTIMPL; +} diff --git a/wrappers/new-dlls/opcservices/opc_private.h b/wrappers/new-dlls/opcservices/opc_private.h new file mode 100644 index 00000000000..c7b1d0cab3d --- /dev/null +++ b/wrappers/new-dlls/opcservices/opc_private.h @@ -0,0 +1,69 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "msopc.h" +#include "wine/heap.h" + +static inline BOOL opc_array_reserve(void **elements, size_t *capacity, size_t count, size_t size) +{ + size_t new_capacity, max_capacity; + void *new_elements; + + if (count <= *capacity) + return TRUE; + + max_capacity = ~(SIZE_T)0 / size; + if (count > max_capacity) + return FALSE; + + new_capacity = max(4, *capacity); + while (new_capacity < count && new_capacity <= max_capacity / 2) + new_capacity *= 2; + if (new_capacity < count) + new_capacity = max_capacity; + + if (!(new_elements = heap_realloc(*elements, new_capacity * size))) + return FALSE; + + *elements = new_elements; + *capacity = new_capacity; + return TRUE; +} + +struct opc_uri +{ + IOpcPartUri IOpcPartUri_iface; + LONG refcount; + BOOL is_part_uri; + + IUri *uri; + IUri *rels_part_uri; + struct opc_uri *source_uri; +}; + +extern HRESULT opc_package_create(IOpcFactory *factory, IOpcPackage **package) DECLSPEC_HIDDEN; +extern HRESULT opc_part_uri_create(IUri *uri, struct opc_uri *source_uri, IOpcPartUri **part_uri) DECLSPEC_HIDDEN; +extern HRESULT opc_root_uri_create(IOpcUri **opc_uri) DECLSPEC_HIDDEN; + +extern HRESULT opc_package_write(IOpcPackage *package, OPC_WRITE_FLAGS flags, IStream *stream) DECLSPEC_HIDDEN; + +struct zip_archive; +extern HRESULT compress_create_archive(IStream *output, struct zip_archive **archive) DECLSPEC_HIDDEN; +extern HRESULT compress_add_file(struct zip_archive *archive, const WCHAR *path, IStream *content, + OPC_COMPRESSION_OPTIONS options) DECLSPEC_HIDDEN; +extern void compress_finalize_archive(struct zip_archive *archive) DECLSPEC_HIDDEN; diff --git a/wrappers/new-dlls/opcservices/opcservices.idl b/wrappers/new-dlls/opcservices/opcservices.idl new file mode 100644 index 00000000000..689131b3081 --- /dev/null +++ b/wrappers/new-dlls/opcservices/opcservices.idl @@ -0,0 +1,21 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +#include "msopc.idl" diff --git a/wrappers/new-dlls/opcservices/opcservices.spec b/wrappers/new-dlls/opcservices/opcservices.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/wrappers/new-dlls/opcservices/opcservices.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/wrappers/new-dlls/opcservices/package.c b/wrappers/new-dlls/opcservices/package.c new file mode 100644 index 00000000000..df1a71e17e8 --- /dev/null +++ b/wrappers/new-dlls/opcservices/package.c @@ -0,0 +1,2053 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include "windef.h" +#include "winbase.h" +#include "ntsecapi.h" +#include "xmllite.h" + +#include "wine/debug.h" +#include "wine/list.h" + +#include "opc_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msopc); + +struct opc_content +{ + LONG refcount; + BYTE *data; + ULARGE_INTEGER size; +}; + +struct opc_content_stream +{ + IStream IStream_iface; + LONG refcount; + + struct opc_content *content; + ULARGE_INTEGER pos; +}; + +struct opc_package +{ + IOpcPackage IOpcPackage_iface; + LONG refcount; + + IOpcPartSet *part_set; + IOpcRelationshipSet *relationship_set; + IOpcUri *source_uri; +}; + +struct opc_part_enum +{ + IOpcPartEnumerator IOpcPartEnumerator_iface; + LONG refcount; + + struct opc_part_set *part_set; + size_t pos; + GUID id; +}; + +struct opc_part +{ + IOpcPart IOpcPart_iface; + LONG refcount; + + IOpcPartUri *name; + WCHAR *content_type; + DWORD compression_options; + IOpcRelationshipSet *relationship_set; + struct opc_content *content; +}; + +struct opc_part_set +{ + IOpcPartSet IOpcPartSet_iface; + LONG refcount; + + struct opc_part **parts; + size_t size; + size_t count; + GUID id; +}; + +struct opc_rel_enum +{ + IOpcRelationshipEnumerator IOpcRelationshipEnumerator_iface; + LONG refcount; + + struct opc_relationship_set *rel_set; + size_t pos; + GUID id; +}; + +struct opc_relationship +{ + IOpcRelationship IOpcRelationship_iface; + LONG refcount; + + WCHAR *id; + WCHAR *type; + IUri *target; + OPC_URI_TARGET_MODE target_mode; + IOpcUri *source_uri; +}; + +struct opc_relationship_set +{ + IOpcRelationshipSet IOpcRelationshipSet_iface; + LONG refcount; + + struct opc_relationship **relationships; + size_t size; + size_t count; + IOpcUri *source_uri; + GUID id; +}; + +static inline struct opc_package *impl_from_IOpcPackage(IOpcPackage *iface) +{ + return CONTAINING_RECORD(iface, struct opc_package, IOpcPackage_iface); +} + +static inline struct opc_part_set *impl_from_IOpcPartSet(IOpcPartSet *iface) +{ + return CONTAINING_RECORD(iface, struct opc_part_set, IOpcPartSet_iface); +} + +static inline struct opc_part *impl_from_IOpcPart(IOpcPart *iface) +{ + return CONTAINING_RECORD(iface, struct opc_part, IOpcPart_iface); +} + +static inline struct opc_relationship_set *impl_from_IOpcRelationshipSet(IOpcRelationshipSet *iface) +{ + return CONTAINING_RECORD(iface, struct opc_relationship_set, IOpcRelationshipSet_iface); +} + +static inline struct opc_relationship *impl_from_IOpcRelationship(IOpcRelationship *iface) +{ + return CONTAINING_RECORD(iface, struct opc_relationship, IOpcRelationship_iface); +} + +static inline struct opc_content_stream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct opc_content_stream, IStream_iface); +} + +static inline struct opc_part_enum *impl_from_IOpcPartEnumerator(IOpcPartEnumerator *iface) +{ + return CONTAINING_RECORD(iface, struct opc_part_enum, IOpcPartEnumerator_iface); +} + +static inline struct opc_rel_enum *impl_from_IOpcRelationshipEnumerator(IOpcRelationshipEnumerator *iface) +{ + return CONTAINING_RECORD(iface, struct opc_rel_enum, IOpcRelationshipEnumerator_iface); +} + +static void opc_content_release(struct opc_content *content) +{ + ULONG refcount = InterlockedDecrement(&content->refcount); + + if (!refcount) + { + heap_free(content->data); + heap_free(content); + } +} + +static HRESULT opc_part_enum_create(struct opc_part_set *part_set, IOpcPartEnumerator **out); + +static HRESULT WINAPI opc_part_enum_QueryInterface(IOpcPartEnumerator *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(&IID_IOpcPartEnumerator, iid) || + IsEqualIID(&IID_IUnknown, iid)) + { + *out = iface; + IOpcPartEnumerator_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_part_enum_AddRef(IOpcPartEnumerator *iface) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + ULONG refcount = InterlockedIncrement(&part_enum->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_part_enum_Release(IOpcPartEnumerator *iface) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + ULONG refcount = InterlockedDecrement(&part_enum->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + IOpcPartSet_Release(&part_enum->part_set->IOpcPartSet_iface); + heap_free(part_enum); + } + + return refcount; +} + +static BOOL has_part_collection_changed(const struct opc_part_enum *part_enum) +{ + return !IsEqualGUID(&part_enum->id, &part_enum->part_set->id); +} + +static HRESULT WINAPI opc_part_enum_MoveNext(IOpcPartEnumerator *iface, BOOL *has_next) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + + TRACE("iface %p, has_next %p.\n", iface, has_next); + + if (!has_next) + return E_POINTER; + + if (has_part_collection_changed(part_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (part_enum->part_set->count && (part_enum->pos == ~(size_t)0 || part_enum->pos < part_enum->part_set->count)) + part_enum->pos++; + + *has_next = part_enum->pos < part_enum->part_set->count; + + return S_OK; +} + +static HRESULT WINAPI opc_part_enum_MovePrevious(IOpcPartEnumerator *iface, BOOL *has_previous) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + + TRACE("iface %p, has_previous %p.\n", iface, has_previous); + + if (!has_previous) + return E_POINTER; + + if (has_part_collection_changed(part_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (part_enum->pos != ~(size_t)0) + part_enum->pos--; + + *has_previous = part_enum->pos != ~(size_t)0; + + return S_OK; +} + +static HRESULT WINAPI opc_part_enum_GetCurrent(IOpcPartEnumerator *iface, IOpcPart **part) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + + TRACE("iface %p, part %p.\n", iface, part); + + if (!part) + return E_POINTER; + + *part = NULL; + + if (has_part_collection_changed(part_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (part_enum->pos < part_enum->part_set->count) + { + *part = &part_enum->part_set->parts[part_enum->pos]->IOpcPart_iface; + IOpcPart_AddRef(*part); + } + + return *part ? S_OK : OPC_E_ENUM_INVALID_POSITION; +} + +static HRESULT WINAPI opc_part_enum_Clone(IOpcPartEnumerator *iface, IOpcPartEnumerator **out) +{ + struct opc_part_enum *part_enum = impl_from_IOpcPartEnumerator(iface); + + TRACE("iface %p, out %p.\n", iface, out); + + if (!out) + return E_POINTER; + + if (has_part_collection_changed(part_enum)) + { + *out = NULL; + return OPC_E_ENUM_COLLECTION_CHANGED; + } + + return opc_part_enum_create(part_enum->part_set, out); +} + +static const IOpcPartEnumeratorVtbl opc_part_enum_vtbl = +{ + opc_part_enum_QueryInterface, + opc_part_enum_AddRef, + opc_part_enum_Release, + opc_part_enum_MoveNext, + opc_part_enum_MovePrevious, + opc_part_enum_GetCurrent, + opc_part_enum_Clone, +}; + +static HRESULT opc_part_enum_create(struct opc_part_set *part_set, IOpcPartEnumerator **out) +{ + struct opc_part_enum *part_enum; + + if (!(part_enum = heap_alloc_zero(sizeof(*part_enum)))) + return E_OUTOFMEMORY; + + part_enum->IOpcPartEnumerator_iface.lpVtbl = &opc_part_enum_vtbl; + part_enum->refcount = 1; + part_enum->part_set = part_set; + IOpcPartSet_AddRef(&part_set->IOpcPartSet_iface); + part_enum->pos = ~(size_t)0; + part_enum->id = part_set->id; + + *out = &part_enum->IOpcPartEnumerator_iface; + TRACE("Created part enumerator %p.\n", *out); + return S_OK; +} + +static HRESULT opc_rel_enum_create(struct opc_relationship_set *rel_set, IOpcRelationshipEnumerator **out); + +static HRESULT WINAPI opc_rel_enum_QueryInterface(IOpcRelationshipEnumerator *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(&IID_IOpcRelationshipEnumerator, iid) || + IsEqualIID(&IID_IUnknown, iid)) + { + *out = iface; + IOpcRelationshipEnumerator_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_rel_enum_AddRef(IOpcRelationshipEnumerator *iface) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + ULONG refcount = InterlockedIncrement(&rel_enum->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_rel_enum_Release(IOpcRelationshipEnumerator *iface) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + ULONG refcount = InterlockedDecrement(&rel_enum->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + IOpcRelationshipSet_Release(&rel_enum->rel_set->IOpcRelationshipSet_iface); + heap_free(rel_enum); + } + + return refcount; +} + +static BOOL has_rel_collection_changed(const struct opc_rel_enum *rel_enum) +{ + return !IsEqualGUID(&rel_enum->id, &rel_enum->rel_set->id); +} + +static HRESULT WINAPI opc_rel_enum_MoveNext(IOpcRelationshipEnumerator *iface, BOOL *has_next) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + + TRACE("iface %p, has_next %p.\n", iface, has_next); + + if (!has_next) + return E_POINTER; + + if (has_rel_collection_changed(rel_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (rel_enum->rel_set->count && (rel_enum->pos == ~(size_t)0 || rel_enum->pos < rel_enum->rel_set->count)) + rel_enum->pos++; + + *has_next = rel_enum->pos < rel_enum->rel_set->count; + + return S_OK; +} + +static HRESULT WINAPI opc_rel_enum_MovePrevious(IOpcRelationshipEnumerator *iface, BOOL *has_previous) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + + TRACE("iface %p, has_previous %p.\n", iface, has_previous); + + if (!has_previous) + return E_POINTER; + + if (has_rel_collection_changed(rel_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (rel_enum->pos != ~(size_t)0) + rel_enum->pos--; + + *has_previous = rel_enum->pos != ~(size_t)0; + + return S_OK; +} + +static HRESULT WINAPI opc_rel_enum_GetCurrent(IOpcRelationshipEnumerator *iface, IOpcRelationship **rel) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + + TRACE("iface %p, rel %p.\n", iface, rel); + + if (!rel) + return E_POINTER; + + *rel = NULL; + + if (has_rel_collection_changed(rel_enum)) + return OPC_E_ENUM_COLLECTION_CHANGED; + + if (rel_enum->pos < rel_enum->rel_set->count) + { + *rel = &rel_enum->rel_set->relationships[rel_enum->pos]->IOpcRelationship_iface; + IOpcRelationship_AddRef(*rel); + } + + return *rel ? S_OK : OPC_E_ENUM_INVALID_POSITION; +} + +static HRESULT WINAPI opc_rel_enum_Clone(IOpcRelationshipEnumerator *iface, IOpcRelationshipEnumerator **out) +{ + struct opc_rel_enum *rel_enum = impl_from_IOpcRelationshipEnumerator(iface); + + TRACE("iface %p, out %p.\n", iface, out); + + if (!out) + return E_POINTER; + + if (has_rel_collection_changed(rel_enum)) + { + *out = NULL; + return OPC_E_ENUM_COLLECTION_CHANGED; + } + + return opc_rel_enum_create(rel_enum->rel_set, out); +} + +static const IOpcRelationshipEnumeratorVtbl opc_rel_enum_vtbl = +{ + opc_rel_enum_QueryInterface, + opc_rel_enum_AddRef, + opc_rel_enum_Release, + opc_rel_enum_MoveNext, + opc_rel_enum_MovePrevious, + opc_rel_enum_GetCurrent, + opc_rel_enum_Clone, +}; + +static HRESULT opc_rel_enum_create(struct opc_relationship_set *rel_set, IOpcRelationshipEnumerator **out) +{ + struct opc_rel_enum *rel_enum; + + if (!(rel_enum = heap_alloc_zero(sizeof(*rel_enum)))) + return E_OUTOFMEMORY; + + rel_enum->IOpcRelationshipEnumerator_iface.lpVtbl = &opc_rel_enum_vtbl; + rel_enum->refcount = 1; + rel_enum->rel_set = rel_set; + IOpcRelationshipSet_AddRef(&rel_set->IOpcRelationshipSet_iface); + rel_enum->pos = ~(size_t)0; + rel_enum->id = rel_set->id; + + *out = &rel_enum->IOpcRelationshipEnumerator_iface; + TRACE("Created relationship enumerator %p.\n", *out); + return S_OK; +} + +static HRESULT WINAPI opc_content_stream_QueryInterface(IStream *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IStream) || + IsEqualIID(iid, &IID_ISequentialStream) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IStream_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_content_stream_AddRef(IStream *iface) +{ + struct opc_content_stream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedIncrement(&stream->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_content_stream_Release(IStream *iface) +{ + struct opc_content_stream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedDecrement(&stream->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + opc_content_release(stream->content); + heap_free(stream); + } + + return refcount; +} + +static HRESULT WINAPI opc_content_stream_Read(IStream *iface, void *buff, ULONG size, ULONG *num_read) +{ + struct opc_content_stream *stream = impl_from_IStream(iface); + DWORD read = 0; + + TRACE("iface %p, buff %p, size %u, num_read %p.\n", iface, buff, size, num_read); + + if (!num_read) + num_read = &read; + + if (stream->content->size.QuadPart - stream->pos.QuadPart < size) + *num_read = stream->content->size.QuadPart - stream->pos.QuadPart; + else + *num_read = size; + + if (*num_read) + memcpy(buff, stream->content->data + stream->pos.QuadPart, *num_read); + + stream->pos.QuadPart += *num_read; + + return S_OK; +} + +static HRESULT WINAPI opc_content_stream_Write(IStream *iface, const void *data, ULONG size, ULONG *num_written) +{ + struct opc_content_stream *stream = impl_from_IStream(iface); + DWORD written = 0; + + TRACE("iface %p, data %p, size %u, num_written %p.\n", iface, data, size, num_written); + + if (!num_written) + num_written = &written; + + *num_written = 0; + + if (size > stream->content->size.QuadPart - stream->pos.QuadPart) + { + void *ptr = heap_realloc(stream->content->data, stream->pos.QuadPart + size); + if (!ptr) + return E_OUTOFMEMORY; + stream->content->data = ptr; + } + + memcpy(stream->content->data + stream->pos.QuadPart, data, size); + stream->pos.QuadPart += size; + stream->content->size.QuadPart += size; + *num_written = size; + + return S_OK; +} + +static HRESULT WINAPI opc_content_stream_Seek(IStream *iface, LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER *newpos) +{ + struct opc_content_stream *stream = impl_from_IStream(iface); + ULARGE_INTEGER pos; + + TRACE("iface %p, move %s, origin %d, newpos %p.\n", iface, wine_dbgstr_longlong(move.QuadPart), origin, newpos); + + switch (origin) + { + case STREAM_SEEK_SET: + pos.QuadPart = move.QuadPart; + break; + case STREAM_SEEK_CUR: + pos.QuadPart = stream->pos.QuadPart + move.QuadPart; + break; + case STREAM_SEEK_END: + pos.QuadPart = stream->content->size.QuadPart + move.QuadPart; + break; + default: + WARN("Unknown origin mode %d.\n", origin); + return E_INVALIDARG; + } + + stream->pos = pos; + + if (newpos) + *newpos = stream->pos; + + return S_OK; +} + +static HRESULT WINAPI opc_content_stream_SetSize(IStream *iface, ULARGE_INTEGER size) +{ + FIXME("iface %p, size %s stub!\n", iface, wine_dbgstr_longlong(size.QuadPart)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_CopyTo(IStream *iface, IStream *dest, ULARGE_INTEGER size, + ULARGE_INTEGER *num_read, ULARGE_INTEGER *written) +{ + FIXME("iface %p, dest %p, size %s, num_read %p, written %p stub!\n", iface, dest, + wine_dbgstr_longlong(size.QuadPart), num_read, written); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_Commit(IStream *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_Revert(IStream *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_LockRegion(IStream *iface, ULARGE_INTEGER offset, + ULARGE_INTEGER size, DWORD lock_type) +{ + FIXME("iface %p, offset %s, size %s, lock_type %d stub!\n", iface, wine_dbgstr_longlong(offset.QuadPart), + wine_dbgstr_longlong(size.QuadPart), lock_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_UnlockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER size, + DWORD lock_type) +{ + FIXME("iface %p, offset %s, size %s, lock_type %d stub!\n", iface, wine_dbgstr_longlong(offset.QuadPart), + wine_dbgstr_longlong(size.QuadPart), lock_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_Stat(IStream *iface, STATSTG *statstg, DWORD flag) +{ + FIXME("iface %p, statstg %p, flag %d stub!\n", iface, statstg, flag); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_content_stream_Clone(IStream *iface, IStream **result) +{ + FIXME("iface %p, result %p stub!\n", iface, result); + + return E_NOTIMPL; +} + +static const IStreamVtbl opc_content_stream_vtbl = +{ + opc_content_stream_QueryInterface, + opc_content_stream_AddRef, + opc_content_stream_Release, + opc_content_stream_Read, + opc_content_stream_Write, + opc_content_stream_Seek, + opc_content_stream_SetSize, + opc_content_stream_CopyTo, + opc_content_stream_Commit, + opc_content_stream_Revert, + opc_content_stream_LockRegion, + opc_content_stream_UnlockRegion, + opc_content_stream_Stat, + opc_content_stream_Clone, +}; + +static HRESULT opc_content_stream_create(struct opc_content *content, IStream **out) +{ + struct opc_content_stream *stream; + + if (!(stream = heap_alloc_zero(sizeof(*stream)))) + return E_OUTOFMEMORY; + + stream->IStream_iface.lpVtbl = &opc_content_stream_vtbl; + stream->refcount = 1; + stream->content = content; + InterlockedIncrement(&content->refcount); + + *out = &stream->IStream_iface; + + TRACE("Created content stream %p.\n", *out); + return S_OK; +} + +static HRESULT opc_relationship_set_create(IOpcUri *source_uri, IOpcRelationshipSet **relationship_set); + +static WCHAR *opc_strdupW(const WCHAR *str) +{ + WCHAR *ret = NULL; + + if (str) + { + size_t size; + + size = (lstrlenW(str) + 1) * sizeof(WCHAR); + ret = CoTaskMemAlloc(size); + if (ret) + memcpy(ret, str, size); + } + + return ret; +} + +static HRESULT WINAPI opc_part_QueryInterface(IOpcPart *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcPart) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcPart_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_part_AddRef(IOpcPart *iface) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + ULONG refcount = InterlockedIncrement(&part->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_part_Release(IOpcPart *iface) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + ULONG refcount = InterlockedDecrement(&part->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + if (part->relationship_set) + IOpcRelationshipSet_Release(part->relationship_set); + IOpcPartUri_Release(part->name); + CoTaskMemFree(part->content_type); + opc_content_release(part->content); + heap_free(part); + } + + return refcount; +} + +static HRESULT WINAPI opc_part_GetRelationshipSet(IOpcPart *iface, IOpcRelationshipSet **relationship_set) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + HRESULT hr; + + TRACE("iface %p, relationship_set %p.\n", iface, relationship_set); + + if (!part->relationship_set && FAILED(hr = opc_relationship_set_create((IOpcUri *)part->name, &part->relationship_set))) + return hr; + + *relationship_set = part->relationship_set; + IOpcRelationshipSet_AddRef(*relationship_set); + + return S_OK; +} + +static HRESULT WINAPI opc_part_GetContentStream(IOpcPart *iface, IStream **stream) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + + TRACE("iface %p, stream %p.\n", iface, stream); + + if (!stream) + return E_POINTER; + + return opc_content_stream_create(part->content, stream); +} + +static HRESULT WINAPI opc_part_GetName(IOpcPart *iface, IOpcPartUri **name) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + + TRACE("iface %p, name %p.\n", iface, name); + + *name = part->name; + IOpcPartUri_AddRef(*name); + + return S_OK; +} + +static HRESULT WINAPI opc_part_GetContentType(IOpcPart *iface, LPWSTR *type) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + + TRACE("iface %p, type %p.\n", iface, type); + + *type = opc_strdupW(part->content_type); + return *type ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI opc_part_GetCompressionOptions(IOpcPart *iface, OPC_COMPRESSION_OPTIONS *options) +{ + struct opc_part *part = impl_from_IOpcPart(iface); + + TRACE("iface %p, options %p.\n", iface, options); + + *options = part->compression_options; + return S_OK; +} + +static const IOpcPartVtbl opc_part_vtbl = +{ + opc_part_QueryInterface, + opc_part_AddRef, + opc_part_Release, + opc_part_GetRelationshipSet, + opc_part_GetContentStream, + opc_part_GetName, + opc_part_GetContentType, + opc_part_GetCompressionOptions, +}; + +static HRESULT opc_part_create(struct opc_part_set *set, IOpcPartUri *name, const WCHAR *content_type, + DWORD compression_options, IOpcPart **out) +{ + struct opc_part *part; + + if (!opc_array_reserve((void **)&set->parts, &set->size, set->count + 1, sizeof(*set->parts))) + return E_OUTOFMEMORY; + + if (!(part = heap_alloc_zero(sizeof(*part)))) + return E_OUTOFMEMORY; + + part->IOpcPart_iface.lpVtbl = &opc_part_vtbl; + part->refcount = 1; + part->name = name; + IOpcPartUri_AddRef(name); + part->compression_options = compression_options; + if (!(part->content_type = opc_strdupW(content_type))) + { + IOpcPart_Release(&part->IOpcPart_iface); + return E_OUTOFMEMORY; + } + + part->content = heap_alloc_zero(sizeof(*part->content)); + if (!part->content) + { + IOpcPart_Release(&part->IOpcPart_iface); + return E_OUTOFMEMORY; + } + part->content->refcount = 1; + + set->parts[set->count++] = part; + IOpcPart_AddRef(&part->IOpcPart_iface); + CoCreateGuid(&set->id); + + *out = &part->IOpcPart_iface; + TRACE("Created part %p.\n", *out); + return S_OK; +} + +static struct opc_part *opc_part_set_get_part(const struct opc_part_set *part_set, IOpcPartUri *name) +{ + BOOL is_equal; + size_t i; + + for (i = 0; i < part_set->count; ++i) + { + is_equal = FALSE; + if (IOpcPartUri_IsEqual(part_set->parts[i]->name, (IUri *)name, &is_equal) == S_OK && is_equal) + return part_set->parts[i]; + } + + return NULL; +} + +static HRESULT WINAPI opc_part_set_QueryInterface(IOpcPartSet *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcPartSet) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcPartSet_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_part_set_AddRef(IOpcPartSet *iface) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + ULONG refcount = InterlockedIncrement(&part_set->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_part_set_Release(IOpcPartSet *iface) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + ULONG refcount = InterlockedDecrement(&part_set->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + size_t i; + + for (i = 0; i < part_set->count; ++i) + IOpcPart_Release(&part_set->parts[i]->IOpcPart_iface); + heap_free(part_set->parts); + heap_free(part_set); + } + + return refcount; +} + +static HRESULT WINAPI opc_part_set_GetPart(IOpcPartSet *iface, IOpcPartUri *name, IOpcPart **out) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + struct opc_part *part; + + TRACE("iface %p, name %p, out %p.\n", iface, name, out); + + if (!out) + return E_POINTER; + + *out = NULL; + + if (!name) + return E_POINTER; + + if ((part = opc_part_set_get_part(part_set, name))) + { + *out = &part->IOpcPart_iface; + IOpcPart_AddRef(*out); + } + + return *out ? S_OK : OPC_E_NO_SUCH_PART; +} + +static HRESULT WINAPI opc_part_set_CreatePart(IOpcPartSet *iface, IOpcPartUri *name, LPCWSTR content_type, + OPC_COMPRESSION_OPTIONS compression_options, IOpcPart **part) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + + TRACE("iface %p, name %p, content_type %s, compression_options %#x, part %p.\n", iface, name, + debugstr_w(content_type), compression_options, part); + + if (!part) + return E_POINTER; + + *part = NULL; + + if (!name) + return E_POINTER; + + if (opc_part_set_get_part(part_set, name)) + return OPC_E_DUPLICATE_PART; + + return opc_part_create(part_set, name, content_type, compression_options, part); +} + +static HRESULT WINAPI opc_part_set_DeletePart(IOpcPartSet *iface, IOpcPartUri *name) +{ + FIXME("iface %p, name %p stub!\n", iface, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_part_set_PartExists(IOpcPartSet *iface, IOpcPartUri *name, BOOL *exists) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + + TRACE("iface %p, name %p, exists %p.\n", iface, name, exists); + + if (!name || !exists) + return E_POINTER; + + *exists = opc_part_set_get_part(part_set, name) != NULL; + + return S_OK; +} + +static HRESULT WINAPI opc_part_set_GetEnumerator(IOpcPartSet *iface, IOpcPartEnumerator **enumerator) +{ + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); + + TRACE("iface %p, enumerator %p.\n", iface, enumerator); + + if (!enumerator) + return E_POINTER; + + return opc_part_enum_create(part_set, enumerator); +} + +static const IOpcPartSetVtbl opc_part_set_vtbl = +{ + opc_part_set_QueryInterface, + opc_part_set_AddRef, + opc_part_set_Release, + opc_part_set_GetPart, + opc_part_set_CreatePart, + opc_part_set_DeletePart, + opc_part_set_PartExists, + opc_part_set_GetEnumerator, +}; + +static HRESULT WINAPI opc_relationship_QueryInterface(IOpcRelationship *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcRelationship) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcRelationship_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_relationship_AddRef(IOpcRelationship *iface) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + ULONG refcount = InterlockedIncrement(&relationship->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_relationship_Release(IOpcRelationship *iface) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + ULONG refcount = InterlockedDecrement(&relationship->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + CoTaskMemFree(relationship->id); + CoTaskMemFree(relationship->type); + IOpcUri_Release(relationship->source_uri); + IUri_Release(relationship->target); + heap_free(relationship); + } + + return refcount; +} + +static HRESULT WINAPI opc_relationship_GetId(IOpcRelationship *iface, WCHAR **id) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + + TRACE("iface %p, id %p.\n", iface, id); + + *id = opc_strdupW(relationship->id); + return *id ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI opc_relationship_GetRelationshipType(IOpcRelationship *iface, WCHAR **type) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + + TRACE("iface %p, type %p.\n", iface, type); + + *type = opc_strdupW(relationship->type); + return *type ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI opc_relationship_GetSourceUri(IOpcRelationship *iface, IOpcUri **uri) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + + TRACE("iface %p, uri %p.\n", iface, uri); + + *uri = relationship->source_uri; + IOpcUri_AddRef(*uri); + + return S_OK; +} + +static HRESULT WINAPI opc_relationship_GetTargetUri(IOpcRelationship *iface, IUri **target) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + + TRACE("iface %p, target %p.\n", iface, target); + + *target = relationship->target; + IUri_AddRef(*target); + + return S_OK; +} + +static HRESULT WINAPI opc_relationship_GetTargetMode(IOpcRelationship *iface, OPC_URI_TARGET_MODE *target_mode) +{ + struct opc_relationship *relationship = impl_from_IOpcRelationship(iface); + + TRACE("iface %p, target_mode %p.\n", iface, target_mode); + + *target_mode = relationship->target_mode; + + return S_OK; +} + +static const IOpcRelationshipVtbl opc_relationship_vtbl = +{ + opc_relationship_QueryInterface, + opc_relationship_AddRef, + opc_relationship_Release, + opc_relationship_GetId, + opc_relationship_GetRelationshipType, + opc_relationship_GetSourceUri, + opc_relationship_GetTargetUri, + opc_relationship_GetTargetMode, +}; + +static struct opc_relationship *opc_relationshipset_get_rel(struct opc_relationship_set *relationship_set, + const WCHAR *id) +{ + size_t i; + + for (i = 0; i < relationship_set->count; i++) + { + if (!wcscmp(id, relationship_set->relationships[i]->id)) + return relationship_set->relationships[i]; + } + + return NULL; +} + +static HRESULT opc_relationship_create(struct opc_relationship_set *set, const WCHAR *id, const WCHAR *type, + IUri *target_uri, OPC_URI_TARGET_MODE target_mode, IOpcRelationship **out) +{ + struct opc_relationship *relationship; + + if (!opc_array_reserve((void **)&set->relationships, &set->size, set->count + 1, sizeof(*set->relationships))) + return E_OUTOFMEMORY; + + if (!(relationship = heap_alloc_zero(sizeof(*relationship)))) + return E_OUTOFMEMORY; + + relationship->IOpcRelationship_iface.lpVtbl = &opc_relationship_vtbl; + relationship->refcount = 1; + + relationship->target = target_uri; + IUri_AddRef(relationship->target); + relationship->source_uri = set->source_uri; + IOpcUri_AddRef(relationship->source_uri); + + if (id) + relationship->id = opc_strdupW(id); + else + { + relationship->id = CoTaskMemAlloc(10 * sizeof(WCHAR)); + if (relationship->id) + { + DWORD generated; + + /* FIXME: test that generated id is unique */ + RtlGenRandom(&generated, sizeof(generated)); + swprintf(relationship->id, 10, L"R%08X", generated); + + if (opc_relationshipset_get_rel(set, relationship->id)) + { + WARN("Newly generated id %s already exists.\n", debugstr_w(relationship->id)); + IOpcRelationship_Release(&relationship->IOpcRelationship_iface); + return E_FAIL; + } + } + } + + relationship->type = opc_strdupW(type); + if (!relationship->id || !relationship->type) + { + IOpcRelationship_Release(&relationship->IOpcRelationship_iface); + return E_OUTOFMEMORY; + } + + set->relationships[set->count++] = relationship; + IOpcRelationship_AddRef(&relationship->IOpcRelationship_iface); + CoCreateGuid(&set->id); + + *out = &relationship->IOpcRelationship_iface; + TRACE("Created relationship %p.\n", *out); + return S_OK; +} + +static HRESULT WINAPI opc_relationship_set_QueryInterface(IOpcRelationshipSet *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcRelationshipSet) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcRelationshipSet_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_relationship_set_AddRef(IOpcRelationshipSet *iface) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + ULONG refcount = InterlockedIncrement(&relationship_set->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_relationship_set_Release(IOpcRelationshipSet *iface) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + ULONG refcount = InterlockedDecrement(&relationship_set->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + size_t i; + + for (i = 0; i < relationship_set->count; ++i) + IOpcRelationship_Release(&relationship_set->relationships[i]->IOpcRelationship_iface); + IOpcUri_Release(relationship_set->source_uri); + heap_free(relationship_set->relationships); + heap_free(relationship_set); + } + + return refcount; +} + +static HRESULT WINAPI opc_relationship_set_GetRelationship(IOpcRelationshipSet *iface, const WCHAR *id, + IOpcRelationship **relationship) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + struct opc_relationship *ret; + + TRACE("iface %p, id %s, relationship %p.\n", iface, debugstr_w(id), relationship); + + if (!relationship) + return E_POINTER; + + *relationship = NULL; + + if (!id) + return E_POINTER; + + if ((ret = opc_relationshipset_get_rel(relationship_set, id))) + { + *relationship = &ret->IOpcRelationship_iface; + IOpcRelationship_AddRef(*relationship); + } + + return *relationship ? S_OK : OPC_E_NO_SUCH_RELATIONSHIP; +} + +static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSet *iface, const WCHAR *id, + const WCHAR *type, IUri *target_uri, OPC_URI_TARGET_MODE target_mode, IOpcRelationship **relationship) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + DWORD length; + + TRACE("iface %p, id %s, type %s, target_uri %p, target_mode %d, relationship %p.\n", iface, debugstr_w(id), + debugstr_w(type), target_uri, target_mode, relationship); + + if (!relationship) + return E_POINTER; + + *relationship = NULL; + + if (!type || !target_uri) + return E_POINTER; + + if (id && opc_relationshipset_get_rel(relationship_set, id)) + return OPC_E_DUPLICATE_RELATIONSHIP; + + if (IUri_GetPropertyLength(target_uri, Uri_PROPERTY_SCHEME_NAME, &length, 0) == S_OK && length != 0 + && target_mode == OPC_URI_TARGET_MODE_INTERNAL) + return OPC_E_INVALID_RELATIONSHIP_TARGET; + + return opc_relationship_create(relationship_set, id, type, target_uri, target_mode, relationship); +} + +static HRESULT WINAPI opc_relationship_set_DeleteRelationship(IOpcRelationshipSet *iface, const WCHAR *id) +{ + FIXME("iface %p, id %s stub!\n", iface, debugstr_w(id)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_relationship_set_RelationshipExists(IOpcRelationshipSet *iface, const WCHAR *id, BOOL *exists) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + + TRACE("iface %p, id %s, exists %p.\n", iface, debugstr_w(id), exists); + + if (!id || !exists) + return E_POINTER; + + *exists = opc_relationshipset_get_rel(relationship_set, id) != NULL; + + return S_OK; +} + +static HRESULT WINAPI opc_relationship_set_GetEnumerator(IOpcRelationshipSet *iface, + IOpcRelationshipEnumerator **enumerator) +{ + struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + + TRACE("iface %p, enumerator %p.\n", iface, enumerator); + + if (!enumerator) + return E_POINTER; + + return opc_rel_enum_create(relationship_set, enumerator); +} + +static HRESULT WINAPI opc_relationship_set_GetEnumeratorForType(IOpcRelationshipSet *iface, const WCHAR *type, + IOpcRelationshipEnumerator **enumerator) +{ + FIXME("iface %p, type %s, enumerator %p stub!\n", iface, debugstr_w(type), enumerator); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_relationship_set_GetRelationshipsContentStream(IOpcRelationshipSet *iface, IStream **stream) +{ + FIXME("iface %p, stream %p stub!\n", iface, stream); + + return E_NOTIMPL; +} + +static const IOpcRelationshipSetVtbl opc_relationship_set_vtbl = +{ + opc_relationship_set_QueryInterface, + opc_relationship_set_AddRef, + opc_relationship_set_Release, + opc_relationship_set_GetRelationship, + opc_relationship_set_CreateRelationship, + opc_relationship_set_DeleteRelationship, + opc_relationship_set_RelationshipExists, + opc_relationship_set_GetEnumerator, + opc_relationship_set_GetEnumeratorForType, + opc_relationship_set_GetRelationshipsContentStream, +}; + +static HRESULT opc_relationship_set_create(IOpcUri *source_uri, IOpcRelationshipSet **out) +{ + struct opc_relationship_set *relationship_set; + + if (!(relationship_set = heap_alloc_zero(sizeof(*relationship_set)))) + return E_OUTOFMEMORY; + + relationship_set->IOpcRelationshipSet_iface.lpVtbl = &opc_relationship_set_vtbl; + relationship_set->refcount = 1; + relationship_set->source_uri = source_uri; + IOpcUri_AddRef(relationship_set->source_uri); + + *out = &relationship_set->IOpcRelationshipSet_iface; + TRACE("Created relationship set %p.\n", *out); + return S_OK; +} + +static HRESULT WINAPI opc_package_QueryInterface(IOpcPackage *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcPackage) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcPackage_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_package_AddRef(IOpcPackage *iface) +{ + struct opc_package *package = impl_from_IOpcPackage(iface); + ULONG refcount = InterlockedIncrement(&package->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_package_Release(IOpcPackage *iface) +{ + struct opc_package *package = impl_from_IOpcPackage(iface); + ULONG refcount = InterlockedDecrement(&package->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + if (package->part_set) + IOpcPartSet_Release(package->part_set); + if (package->relationship_set) + IOpcRelationshipSet_Release(package->relationship_set); + if (package->source_uri) + IOpcUri_Release(package->source_uri); + heap_free(package); + } + + return refcount; +} + +static HRESULT WINAPI opc_package_GetPartSet(IOpcPackage *iface, IOpcPartSet **part_set) +{ + struct opc_package *package = impl_from_IOpcPackage(iface); + + TRACE("iface %p, part_set %p.\n", iface, part_set); + + if (!package->part_set) + { + struct opc_part_set *part_set = heap_alloc_zero(sizeof(*part_set)); + if (!part_set) + return E_OUTOFMEMORY; + + part_set->IOpcPartSet_iface.lpVtbl = &opc_part_set_vtbl; + part_set->refcount = 1; + + package->part_set = &part_set->IOpcPartSet_iface; + } + + *part_set = package->part_set; + IOpcPartSet_AddRef(*part_set); + + return S_OK; +} + +static HRESULT WINAPI opc_package_GetRelationshipSet(IOpcPackage *iface, IOpcRelationshipSet **relationship_set) +{ + struct opc_package *package = impl_from_IOpcPackage(iface); + HRESULT hr; + + TRACE("iface %p, relationship_set %p.\n", iface, relationship_set); + + if (!package->relationship_set) + { + if (FAILED(hr = opc_relationship_set_create(package->source_uri, &package->relationship_set))) + return hr; + } + + *relationship_set = package->relationship_set; + IOpcRelationshipSet_AddRef(*relationship_set); + + return S_OK; +} + +static const IOpcPackageVtbl opc_package_vtbl = +{ + opc_package_QueryInterface, + opc_package_AddRef, + opc_package_Release, + opc_package_GetPartSet, + opc_package_GetRelationshipSet, +}; + +HRESULT opc_package_create(IOpcFactory *factory, IOpcPackage **out) +{ + struct opc_package *package; + HRESULT hr; + + if (!(package = heap_alloc_zero(sizeof(*package)))) + return E_OUTOFMEMORY; + + package->IOpcPackage_iface.lpVtbl = &opc_package_vtbl; + package->refcount = 1; + + if (FAILED(hr = IOpcFactory_CreatePackageRootUri(factory, &package->source_uri))) + { + heap_free(package); + return hr; + } + + *out = &package->IOpcPackage_iface; + TRACE("Created package %p.\n", *out); + return S_OK; +} + +struct content_types +{ + struct list types; + BOOL has_rels_part; +}; + +enum content_type_element +{ + CONTENT_TYPE_DEFAULT, + CONTENT_TYPE_OVERRIDE, +}; + +struct content_type +{ + struct list entry; + enum content_type_element element; + union + { + struct default_type + { + WCHAR *ext; + WCHAR *type; + } def; + struct override_type + { + IOpcPart *part; + } override; + } u; +}; + +static HRESULT opc_package_add_override_content_type(struct content_types *types, IOpcPart *part) +{ + struct content_type *type; + + if (!(type = heap_alloc(sizeof(*type)))) + return E_OUTOFMEMORY; + + type->element = CONTENT_TYPE_OVERRIDE; + type->u.override.part = part; + IOpcPart_AddRef(part); + + list_add_tail(&types->types, &type->entry); + + return S_OK; +} + +static HRESULT opc_package_add_default_content_type(struct content_types *types, + const WCHAR *ext, const WCHAR *content_type) +{ + struct content_type *type; + + if (!(type = heap_alloc(sizeof(*type)))) + return E_OUTOFMEMORY; + + type->element = CONTENT_TYPE_DEFAULT; + type->u.def.ext = opc_strdupW(ext); + type->u.def.type = opc_strdupW(content_type); + if (!type->u.def.ext || !type->u.def.type) + { + CoTaskMemFree(type->u.def.ext); + CoTaskMemFree(type->u.def.type); + heap_free(type); + return E_OUTOFMEMORY; + } + + list_add_tail(&types->types, &type->entry); + + return S_OK; +} + +static HRESULT opc_package_add_content_type(struct content_types *types, IOpcPart *part) +{ + struct content_type *cur; + BSTR ext, content_type; + BOOL added = FALSE; + IOpcPartUri *name; + HRESULT hr; + + if (FAILED(hr = IOpcPart_GetName(part, &name))) + return hr; + + hr = IOpcPartUri_GetExtension(name, &ext); + IOpcPartUri_Release(name); + if (hr == S_FALSE) + { + hr = opc_package_add_override_content_type(types, part); + SysFreeString(ext); + return hr; + } + + if (FAILED(hr)) + return hr; + + if (FAILED(hr = IOpcPart_GetContentType(part, &content_type))) + return hr; + + LIST_FOR_EACH_ENTRY(cur, &types->types, struct content_type, entry) + { + if (cur->element == CONTENT_TYPE_OVERRIDE) + continue; + + if (!wcsicmp(cur->u.def.ext, ext)) + { + added = TRUE; + + if (!wcscmp(cur->u.def.type, content_type)) + break; + + hr = opc_package_add_override_content_type(types, part); + break; + } + } + + if (!added) + hr = opc_package_add_default_content_type(types, ext, content_type); + + SysFreeString(ext); + SysFreeString(content_type); + + return hr; +} + +static BOOL opc_package_has_rels_part(IOpcRelationshipSet *rel_set) +{ + IOpcRelationshipEnumerator *enumerator; + BOOL has_next; + HRESULT hr; + + if (FAILED(hr = IOpcRelationshipSet_GetEnumerator(rel_set, &enumerator))) + return FALSE; + + has_next = FALSE; + IOpcRelationshipEnumerator_MoveNext(enumerator, &has_next); + IOpcRelationshipEnumerator_Release(enumerator); + + return has_next; +} + +static HRESULT opc_package_collect_content_types(IOpcPackage *package, struct content_types *types) +{ + IOpcPartEnumerator *enumerator; + IOpcRelationshipSet *rel_set; + IOpcPartSet *parts; + BOOL has_next; + HRESULT hr; + + if (FAILED(hr = IOpcPackage_GetPartSet(package, &parts))) + return hr; + + hr = IOpcPackage_GetRelationshipSet(package, &rel_set); + if (SUCCEEDED(hr)) + { + types->has_rels_part |= opc_package_has_rels_part(rel_set); + IOpcRelationshipSet_Release(rel_set); + } + + hr = IOpcPartSet_GetEnumerator(parts, &enumerator); + IOpcPartSet_Release(parts); + if (FAILED(hr)) + return hr; + + if (FAILED(hr = IOpcPartEnumerator_MoveNext(enumerator, &has_next)) || !has_next) + { + IOpcPartEnumerator_Release(enumerator); + return hr; + } + + while (has_next) + { + IOpcPart *part; + + if (FAILED(hr = IOpcPartEnumerator_GetCurrent(enumerator, &part))) + break; + + if (!types->has_rels_part) + { + hr = IOpcPart_GetRelationshipSet(part, &rel_set); + if (SUCCEEDED(hr)) + { + types->has_rels_part |= opc_package_has_rels_part(rel_set); + IOpcRelationshipSet_Release(rel_set); + } + } + + hr = opc_package_add_content_type(types, part); + IOpcPart_Release(part); + if (FAILED(hr)) + break; + + if (FAILED(hr = IOpcPartEnumerator_MoveNext(enumerator, &has_next))) + break; + } + + IOpcPartEnumerator_Release(enumerator); + + return hr; +} + +static HRESULT opc_package_write_default_type(const WCHAR *ext, const WCHAR *type, IXmlWriter *writer) +{ + HRESULT hr; + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"Default", NULL); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"Extension", NULL, ext); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"ContentType", NULL, type); + return hr; +} + +static HRESULT opc_package_write_contenttypes(IOpcPackage *package, struct zip_archive *archive, IXmlWriter *writer) +{ + struct content_type *content_type, *content_type2; + struct content_types types; + IStream *content = NULL; + HRESULT hr; + + list_init(&types.types); + types.has_rels_part = FALSE; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &content); + if (SUCCEEDED(hr)) + hr = opc_package_collect_content_types(package, &types); + if (SUCCEEDED(hr)) + hr = IXmlWriter_SetOutput(writer, (IUnknown *)content); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteStartElement(writer, NULL, L"Types", + L"http://schemas.openxmlformats.org/package/2006/content-types"); + + if (SUCCEEDED(hr) && types.has_rels_part) + { + hr = opc_package_write_default_type(L"rels", + L"application/vnd.openxmlformats-package.relationships+xml", writer); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteEndElement(writer); + } + + LIST_FOR_EACH_ENTRY_SAFE(content_type, content_type2, &types.types, struct content_type, entry) + { + if (content_type->element == CONTENT_TYPE_DEFAULT) + { + hr = opc_package_write_default_type(content_type->u.def.ext + 1, content_type->u.def.type, writer); + + CoTaskMemFree(content_type->u.def.ext); + CoTaskMemFree(content_type->u.def.type); + } + else + { + IOpcPartUri *uri = NULL; + WCHAR *type = NULL; + BSTR name = NULL; + + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteStartElement(writer, NULL, L"Override", NULL); + if (SUCCEEDED(hr)) + hr = IOpcPart_GetName(content_type->u.override.part, &uri); + if (SUCCEEDED(hr)) + hr = IOpcPartUri_GetRawUri(uri, &name); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"PartName", NULL, name); + if (SUCCEEDED(hr)) + hr = IOpcPart_GetContentType(content_type->u.override.part, &type); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"ContentType", NULL, type); + + if (uri) + IOpcPartUri_Release(uri); + SysFreeString(name); + CoTaskMemFree(type); + + IOpcPart_Release(content_type->u.override.part); + } + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteEndElement(writer); + + list_remove(&content_type->entry); + heap_free(content_type); + } + + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteEndDocument(writer); + if (SUCCEEDED(hr)) + hr = IXmlWriter_Flush(writer); + + if (SUCCEEDED(hr)) + hr = compress_add_file(archive, L"[Content_Types].xml", content, OPC_COMPRESSION_NORMAL); + + if (content) + IStream_Release(content); + + return hr; +} + +static HRESULT opc_package_write_rel(IOpcRelationship *rel, IXmlWriter *writer) +{ + BSTR target_uri; + HRESULT hr; + WCHAR *str; + IUri *uri; + + if (FAILED(hr = IXmlWriter_WriteStartElement(writer, NULL, L"Relationship", NULL))) + return hr; + + if (FAILED(hr = IOpcRelationship_GetTargetUri(rel, &uri))) + return hr; + + IUri_GetRawUri(uri, &target_uri); + IUri_Release(uri); + + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"Target", NULL, target_uri); + SysFreeString(target_uri); + if (FAILED(hr)) + return hr; + + if (FAILED(hr = IOpcRelationship_GetId(rel, &str))) + return hr; + + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"Id", NULL, str); + CoTaskMemFree(str); + if (FAILED(hr)) + return hr; + + if (FAILED(hr = IOpcRelationship_GetRelationshipType(rel, &str))) + return hr; + + hr = IXmlWriter_WriteAttributeString(writer, NULL, L"Type", NULL, str); + CoTaskMemFree(str); + if (FAILED(hr)) + return hr; + + return IXmlWriter_WriteEndElement(writer); +} + +static HRESULT opc_package_write_rels(struct zip_archive *archive, IOpcRelationshipSet *rels, + IOpcUri *uri, IXmlWriter *writer) +{ + IOpcRelationshipEnumerator *enumerator; + BSTR rels_part_uri = NULL; + IOpcPartUri *rels_uri; + IStream *content; + BOOL has_next; + HRESULT hr; + + if (FAILED(hr = IOpcRelationshipSet_GetEnumerator(rels, &enumerator))) + return hr; + + hr = IOpcRelationshipEnumerator_MoveNext(enumerator, &has_next); + if (!has_next) + { + IOpcRelationshipEnumerator_Release(enumerator); + return hr; + } + + if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, &content))) + { + IOpcRelationshipEnumerator_Release(enumerator); + return hr; + } + + hr = IXmlWriter_SetOutput(writer, (IUnknown *)content); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteStartElement(writer, NULL, L"Relationships", + L"http://schemas.openxmlformats.org/package/2006/relationships"); + + while (has_next) + { + IOpcRelationship *rel; + + if (FAILED(hr = IOpcRelationshipEnumerator_GetCurrent(enumerator, &rel))) + break; + + hr = opc_package_write_rel(rel, writer); + IOpcRelationship_Release(rel); + if (FAILED(hr)) + break; + + IOpcRelationshipEnumerator_MoveNext(enumerator, &has_next); + } + + IOpcRelationshipEnumerator_Release(enumerator); + + if (SUCCEEDED(hr)) + hr = IXmlWriter_WriteEndDocument(writer); + if (SUCCEEDED(hr)) + hr = IXmlWriter_Flush(writer); + + if (SUCCEEDED(hr)) + hr = IOpcUri_GetRelationshipsPartUri(uri, &rels_uri); + if (SUCCEEDED(hr)) + hr = IOpcPartUri_GetRawUri(rels_uri, &rels_part_uri); + if (SUCCEEDED(hr)) + { + /* Relationship part names always start with root '/', skip it. */ + hr = compress_add_file(archive, rels_part_uri + 1, content, OPC_COMPRESSION_NORMAL); + } + + SysFreeString(rels_part_uri); + IStream_Release(content); + + return hr; +} + +static HRESULT opc_package_write_part(struct zip_archive *archive, IOpcPart *part, IXmlWriter *writer) +{ + OPC_COMPRESSION_OPTIONS options = OPC_COMPRESSION_NORMAL; + IOpcRelationshipSet *rels = NULL; + IStream *content = NULL; + IOpcPartUri *name; + BSTR uri = NULL; + HRESULT hr; + + if (FAILED(hr = IOpcPart_GetName(part, &name))) + return hr; + + hr = IOpcPartUri_GetRawUri(name, &uri); + if (SUCCEEDED(hr)) + hr = IOpcPart_GetCompressionOptions(part, &options); + if (SUCCEEDED(hr)) + hr = IOpcPart_GetContentStream(part, &content); + if (SUCCEEDED(hr)) + { + /* Part names always start with root '/', skip it. */ + hr = compress_add_file(archive, uri + 1, content, options); + } + if (SUCCEEDED(hr)) + hr = IOpcPart_GetRelationshipSet(part, &rels); + if (SUCCEEDED(hr)) + hr = opc_package_write_rels(archive, rels, (IOpcUri *)name, writer); + + IOpcPartUri_Release(name); + SysFreeString(uri); + if (content) + IStream_Release(content); + if (rels) + IOpcRelationshipSet_Release(rels); + + return hr; +} + +static HRESULT opc_package_write_parts(struct zip_archive *archive, IOpcPackage *package, IXmlWriter *writer) +{ + IOpcPartEnumerator *parts; + IOpcPartSet *part_set; + BOOL got_next; + HRESULT hr; + + if (FAILED(hr = IOpcPackage_GetPartSet(package, &part_set))) + return hr; + + hr = IOpcPartSet_GetEnumerator(part_set, &parts); + IOpcPartSet_Release(part_set); + if (FAILED(hr)) + return hr; + + while (IOpcPartEnumerator_MoveNext(parts, &got_next) == S_OK && got_next) + { + IOpcPart *part; + + if (FAILED(hr = IOpcPartEnumerator_GetCurrent(parts, &part))) + break; + + hr = opc_package_write_part(archive, part, writer); + IOpcPart_Release(part); + if (FAILED(hr)) + break; + } + + IOpcPartEnumerator_Release(parts); + + return hr; +} + +HRESULT opc_package_write(IOpcPackage *package, OPC_WRITE_FLAGS flags, IStream *stream) +{ + IOpcRelationshipSet *rels = NULL; + struct zip_archive *archive; + IOpcUri *uri = NULL; + IXmlWriter *writer; + HRESULT hr; + + if (flags != OPC_WRITE_FORCE_ZIP32) + FIXME("Unsupported write flags %#x.\n", flags); + + if (FAILED(hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL))) + return hr; + + if (FAILED(hr = compress_create_archive(stream, &archive))) + { + IXmlWriter_Release(writer); + return hr; + } + + /* [Content_Types].xml */ + hr = opc_package_write_contenttypes(package, archive, writer); + /* Package relationships. */ + if (SUCCEEDED(hr)) + hr = IOpcPackage_GetRelationshipSet(package, &rels); + if (SUCCEEDED(hr)) + hr = opc_root_uri_create(&uri); + if (SUCCEEDED(hr)) + hr = opc_package_write_rels(archive, rels, uri, writer); + /* Parts. */ + if (SUCCEEDED(hr)) + hr = opc_package_write_parts(archive, package, writer); + + if (rels) + IOpcRelationshipSet_Release(rels); + if (uri) + IOpcUri_Release(uri); + + compress_finalize_archive(archive); + IXmlWriter_Release(writer); + + return hr; +} diff --git a/wrappers/new-dlls/opcservices/tests/Makefile.in b/wrappers/new-dlls/opcservices/tests/Makefile.in new file mode 100644 index 00000000000..4fa222e9273 --- /dev/null +++ b/wrappers/new-dlls/opcservices/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = opcservices.dll +IMPORTS = ole32 urlmon oleaut32 + +C_SRCS = \ + opcservices.c diff --git a/wrappers/new-dlls/opcservices/tests/opcservices.c b/wrappers/new-dlls/opcservices/tests/opcservices.c new file mode 100644 index 00000000000..cd683b0a206 --- /dev/null +++ b/wrappers/new-dlls/opcservices/tests/opcservices.c @@ -0,0 +1,1322 @@ +/* + * OPC Services tests + * + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "windows.h" +#include "initguid.h" +#include "msopc.h" +#include "urlmon.h" + +#include "wine/heap.h" +#include "wine/test.h" + +static IOpcFactory *create_factory(void) +{ + IOpcFactory *factory = NULL; + CoCreateInstance(&CLSID_OpcFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IOpcFactory, (void **)&factory); + return factory; +} + +static void test_package(void) +{ + static const WCHAR typeW[] = {'t','y','p','e','/','s','u','b','t','y','p','e',0}; + static const WCHAR targetW[] = {'t','a','r','g','e','t',0}; + static const WCHAR uriW[] = {'/','u','r','i',0}; + static const WCHAR rootW[] = {'/',0}; + IOpcRelationshipSet *relset, *relset2; + IOpcPartUri *part_uri, *part_uri2; + IOpcPartSet *partset, *partset2; + OPC_COMPRESSION_OPTIONS options; + IStream *stream, *stream2; + IOpcPart *part, *part2; + IOpcRelationship *rel; + IOpcFactory *factory; + IOpcPackage *package; + LARGE_INTEGER move; + ULARGE_INTEGER pos; + IUri *target_uri; + char buff[16]; + IOpcUri *uri; + HRESULT hr; + BSTR str; + BOOL ret; + + factory = create_factory(); + + hr = IOpcFactory_CreatePackage(factory, &package); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr); + if (FAILED(hr)) + { + IOpcFactory_Release(factory); + return; + } + + hr = IOpcPackage_GetPartSet(package, &partset); + ok(SUCCEEDED(hr), "Failed to create a part set, hr %#x.\n", hr); + + hr = IOpcPackage_GetPartSet(package, &partset2); + ok(SUCCEEDED(hr), "Failed to create a part set, hr %#x.\n", hr); + ok(partset == partset2, "Expected same part set instance.\n"); + IOpcPartSet_Release(partset2); + + /* CreatePart */ + hr = IOpcFactory_CreatePartUri(factory, uriW, &part_uri); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + hr = IOpcFactory_CreatePartUri(factory, uriW, &part_uri2); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + part = (void *)0xdeadbeef; + hr = IOpcPartSet_CreatePart(partset, NULL, typeW, OPC_COMPRESSION_NONE, &part); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(part == NULL, "Unexpected pointer %p.\n", part); + + hr = IOpcPartSet_CreatePart(partset, part_uri, typeW, OPC_COMPRESSION_NONE, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartSet_CreatePart(partset, part_uri, typeW, 0xdeadbeef, &part); + ok(SUCCEEDED(hr), "Failed to create a part, hr %#x.\n", hr); + hr = IOpcPart_GetCompressionOptions(part, &options); + ok(SUCCEEDED(hr), "Failed to get compression options, hr %#x.\n", hr); + ok(options == 0xdeadbeef, "Unexpected compression options %#x.\n", options); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartSet_CreatePart(partset, part_uri, typeW, OPC_COMPRESSION_NONE, &part2); + ok(hr == OPC_E_DUPLICATE_PART, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected instance %p.\n", part2); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartSet_CreatePart(partset, part_uri2, typeW, OPC_COMPRESSION_NONE, &part2); + ok(hr == OPC_E_DUPLICATE_PART, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected instance %p.\n", part2); + IOpcPartUri_Release(part_uri2); + + hr = IOpcPartSet_GetPart(partset, NULL, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartSet_GetPart(partset, NULL, &part2); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected pointer %p.\n", part2); + + hr = IOpcPartSet_GetPart(partset, part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartSet_GetPart(partset, part_uri, &part2); + ok(SUCCEEDED(hr), "Failed to get part, hr %#x.\n", hr); + IOpcPart_Release(part2); + + hr = IOpcFactory_CreatePartUri(factory, targetW, &part_uri2); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + hr = IOpcPartSet_GetPart(partset, part_uri2, &part2); + ok(hr == OPC_E_NO_SUCH_PART, "Unexpected hr %#x.\n", hr); + IOpcPartUri_Release(part_uri2); + + hr = IOpcPart_GetContentStream(part, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPart_GetContentStream(part, &stream); + ok(SUCCEEDED(hr), "Failed to get content stream, hr %#x.\n", hr); + + hr = IStream_Write(stream, "abc", 3, NULL); + ok(hr == S_OK, "Failed to write content, hr %#x.\n", hr); + + move.QuadPart = 0; + hr = IStream_Seek(stream, move, STREAM_SEEK_CUR, &pos); + ok(SUCCEEDED(hr), "Seek failed, hr %#x.\n", hr); + ok(pos.QuadPart == 3, "Unexpected position.\n"); + + hr = IOpcPart_GetContentStream(part, &stream2); + ok(SUCCEEDED(hr), "Failed to get content stream, hr %#x.\n", hr); + ok(stream != stream2, "Unexpected instance.\n"); + + move.QuadPart = 0; + hr = IStream_Seek(stream2, move, STREAM_SEEK_CUR, &pos); + ok(SUCCEEDED(hr), "Seek failed, hr %#x.\n", hr); + ok(pos.QuadPart == 0, "Unexpected position.\n"); + + memset(buff, 0, sizeof(buff)); + hr = IStream_Read(stream2, buff, sizeof(buff), NULL); + ok(hr == S_OK, "Failed to read content, hr %#x.\n", hr); + ok(!memcmp(buff, "abc", 3), "Unexpected content.\n"); + + move.QuadPart = 0; + hr = IStream_Seek(stream2, move, STREAM_SEEK_CUR, &pos); + ok(SUCCEEDED(hr), "Seek failed, hr %#x.\n", hr); + ok(pos.QuadPart == 3, "Unexpected position.\n"); + + IStream_Release(stream); + IStream_Release(stream2); + + hr = IOpcPart_GetRelationshipSet(part, &relset); + ok(SUCCEEDED(hr), "Failed to get relationship set, hr %#x.\n", hr); + + hr = IOpcPart_GetRelationshipSet(part, &relset2); + ok(SUCCEEDED(hr), "Failed to get relationship set, hr %#x.\n", hr); + ok(relset == relset2, "Expected same part set instance.\n"); + + hr = CreateUri(targetW, Uri_CREATE_ALLOW_RELATIVE, 0, &target_uri); + ok(SUCCEEDED(hr), "Failed to create target uri, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(relset, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); + + hr = IOpcRelationship_GetSourceUri(rel, &uri); + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + ok(uri == (IOpcUri *)part_uri, "Unexpected source uri.\n"); + + IOpcUri_Release(uri); + + IOpcRelationship_Release(rel); + IUri_Release(target_uri); + + IOpcRelationshipSet_Release(relset); + IOpcRelationshipSet_Release(relset2); + + ret = 123; + hr = IOpcPartSet_PartExists(partset, NULL, &ret); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected return value.\n"); + + hr = IOpcPartSet_PartExists(partset, part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = FALSE; + hr = IOpcPartSet_PartExists(partset, part_uri, &ret); + ok(SUCCEEDED(hr), "Unexpected hr %#x.\n", hr); + ok(ret, "Expected part to exist.\n"); + + IOpcPartUri_Release(part_uri); + IOpcPart_Release(part); + + /* Relationships */ + hr = IOpcPackage_GetRelationshipSet(package, &relset); + ok(SUCCEEDED(hr), "Failed to get relationship set, hr %#x.\n", hr); + + hr = IOpcPackage_GetRelationshipSet(package, &relset2); + ok(SUCCEEDED(hr), "Failed to get relationship set, hr %#x.\n", hr); + ok(relset == relset2, "Expected same part set instance.\n"); + IOpcRelationshipSet_Release(relset); + IOpcRelationshipSet_Release(relset2); + + IOpcPartSet_Release(partset); + IOpcPackage_Release(package); + + /* Root uri */ + hr = IOpcFactory_CreatePackageRootUri(factory, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + hr = IOpcFactory_CreatePackageRootUri(factory, &uri); + ok(SUCCEEDED(hr), "Failed to create root uri, hr %#x.\n", hr); + hr = IOpcUri_GetRawUri(uri, &str); + ok(SUCCEEDED(hr), "Failed to get raw uri, hr %#x.\n", hr); + ok(!lstrcmpW(str, rootW), "Unexpected uri %s.\n", wine_dbgstr_w(str)); + SysFreeString(str); + IOpcUri_Release(uri); + + IOpcFactory_Release(factory); +} + +#define test_stream_stat(stream, size) test_stream_stat_(__LINE__, stream, size) +static void test_stream_stat_(unsigned int line, IStream *stream, ULONG size) +{ + STATSTG statstg; + HRESULT hr; + + hr = IStream_Stat(stream, NULL, 0); + ok_(__FILE__, line)(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + memset(&statstg, 0xff, sizeof(statstg)); + hr = IStream_Stat(stream, &statstg, 0); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get stat info, hr %#x.\n", hr); + + ok_(__FILE__, line)(statstg.pwcsName == NULL, "Unexpected name %s.\n", wine_dbgstr_w(statstg.pwcsName)); + ok_(__FILE__, line)(statstg.type == STGTY_STREAM, "Unexpected type.\n"); + ok_(__FILE__, line)(statstg.cbSize.QuadPart == size, "Unexpected size %u, expected %u.\n", + statstg.cbSize.LowPart, size); + ok_(__FILE__, line)(statstg.grfMode == STGM_READ, "Unexpected mode.\n"); + ok_(__FILE__, line)(statstg.grfLocksSupported == 0, "Unexpected lock mode.\n"); + ok_(__FILE__, line)(statstg.grfStateBits == 0, "Unexpected state bits.\n"); +} + +static void test_file_stream(void) +{ + static const WCHAR filereadW[] = {'o','p','c','f','i','l','e','r','e','a','d','.','e','x','t',0}; + WCHAR temppathW[MAX_PATH], pathW[MAX_PATH]; + IOpcFactory *factory; + LARGE_INTEGER move; + IStream *stream; + char buff[64]; + HRESULT hr; + ULONG size; + + factory = create_factory(); + + hr = IOpcFactory_CreateStreamOnFile(factory, NULL, OPC_STREAM_IO_READ, NULL, 0, &stream); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + GetTempPathW(ARRAY_SIZE(temppathW), temppathW); + lstrcpyW(pathW, temppathW); + lstrcatW(pathW, filereadW); + DeleteFileW(pathW); + + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, OPC_STREAM_IO_READ, NULL, 0, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + /* File does not exist */ + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, OPC_STREAM_IO_READ, NULL, 0, &stream); + ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, OPC_STREAM_IO_WRITE, NULL, 0, &stream); + ok(SUCCEEDED(hr), "Failed to create a write stream, hr %#x.\n", hr); + + test_stream_stat(stream, 0); + + size = lstrlenW(pathW) * sizeof(WCHAR); + hr = IStream_Write(stream, pathW, size, NULL); + ok(hr == S_OK, "Stream write failed, hr %#x.\n", hr); + + test_stream_stat(stream, size); + IStream_Release(stream); + + /* Invalid I/O mode */ + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, 10, NULL, 0, &stream); + ok(hr == E_INVALIDARG, "Failed to create a write stream, hr %#x.\n", hr); + + /* Write to read-only stream. */ + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, OPC_STREAM_IO_READ, NULL, 0, &stream); + ok(SUCCEEDED(hr), "Failed to create a read stream, hr %#x.\n", hr); + + test_stream_stat(stream, size); + hr = IStream_Write(stream, pathW, size, NULL); + ok(hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), "Stream write failed, hr %#x.\n", hr); + IStream_Release(stream); + + /* Read from write-only stream. */ + hr = IOpcFactory_CreateStreamOnFile(factory, pathW, OPC_STREAM_IO_WRITE, NULL, 0, &stream); + ok(SUCCEEDED(hr), "Failed to create a read stream, hr %#x.\n", hr); + + test_stream_stat(stream, 0); + hr = IStream_Write(stream, pathW, size, NULL); + ok(hr == S_OK, "Stream write failed, hr %#x.\n", hr); + test_stream_stat(stream, size); + + move.QuadPart = 0; + hr = IStream_Seek(stream, move, STREAM_SEEK_SET, NULL); + ok(SUCCEEDED(hr), "Seek failed, hr %#x.\n", hr); + + hr = IStream_Read(stream, buff, sizeof(buff), NULL); + ok(hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), "Stream read failed, hr %#x.\n", hr); + + IStream_Release(stream); + + IOpcFactory_Release(factory); + DeleteFileW(pathW); +} + +static void test_relationship(void) +{ + static const WCHAR absoluteW[] = {'f','i','l','e',':','/','/','h','o','s','t','/','f','i','l','e','.','t','x','t',0}; + static const WCHAR targetW[] = {'t','a','r','g','e','t',0}; + static const WCHAR typeW[] = {'t','y','p','e',0}; + static const WCHAR rootW[] = {'/',0}; + IUri *target_uri, *target_uri2, *uri; + IOpcRelationship *rel, *rel2, *rel3; + IOpcUri *source_uri, *source_uri2; + IOpcRelationshipSet *rels; + IOpcFactory *factory; + IOpcPackage *package; + IUnknown *unk; + DWORD mode; + HRESULT hr; + WCHAR *id; + BOOL ret; + BSTR str; + + factory = create_factory(); + + hr = IOpcFactory_CreatePackage(factory, &package); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr); + if (FAILED(hr)) + { + IOpcFactory_Release(factory); + return; + } + + hr = CreateUri(targetW, Uri_CREATE_ALLOW_RELATIVE, 0, &target_uri); + ok(SUCCEEDED(hr), "Failed to create target uri, hr %#x.\n", hr); + + hr = CreateUri(absoluteW, 0, 0, &target_uri2); + ok(SUCCEEDED(hr), "Failed to create target uri, hr %#x.\n", hr); + + hr = IOpcPackage_GetRelationshipSet(package, &rels); + ok(SUCCEEDED(hr), "Failed to get part set, hr %#x.\n", hr); + + rel = (void *)0xdeadbeef; + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, NULL, NULL, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(rel == NULL, "Unexpected instance %p.\n", rel); + + rel = (void *)0xdeadbeef; + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, NULL, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(rel == NULL, "Unexpected instance %p.\n", rel); + + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, NULL, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + /* Absolute target uri with internal mode */ + rel = (void *)0xdeadbeef; + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri2, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(hr == OPC_E_INVALID_RELATIONSHIP_TARGET, "Unexpected hr %#x.\n", hr); + ok(rel == NULL, "Unexpected instance %p.\n", rel); + + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); + + /* Autogenerated relationship id */ + hr = IOpcRelationship_GetId(rel, &id); + ok(SUCCEEDED(hr), "Failed to get id, hr %#x.\n", hr); + ok(lstrlenW(id) == 9 && *id == 'R', "Unexpected relationship id %s.\n", wine_dbgstr_w(id)); + + hr = IOpcRelationshipSet_CreateRelationship(rels, id, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(hr == OPC_E_DUPLICATE_RELATIONSHIP, "Failed to create relationship, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(rels, id, typeW, target_uri2, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(hr == OPC_E_DUPLICATE_RELATIONSHIP, "Failed to create relationship, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); + + ret = 123; + hr = IOpcRelationshipSet_RelationshipExists(rels, NULL, &ret); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipSet_RelationshipExists(rels, id, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = FALSE; + hr = IOpcRelationshipSet_RelationshipExists(rels, id, &ret); + ok(SUCCEEDED(hr), "Failed to get relationship, hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipSet_GetRelationship(rels, id, &rel3); + ok(SUCCEEDED(hr), "Failed to get relationship, hr %#x.\n", hr); + IOpcRelationship_Release(rel3); + + hr = IOpcRelationshipSet_GetRelationship(rels, id, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + rel3 = (void *)0xdeadbeef; + hr = IOpcRelationshipSet_GetRelationship(rels, NULL, &rel3); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(rel3 == NULL, "Expected null pointer.\n"); + + *id = 'r'; + rel3 = (void *)0xdeadbeef; + hr = IOpcRelationshipSet_GetRelationship(rels, id, &rel3); + ok(hr == OPC_E_NO_SUCH_RELATIONSHIP, "Unexpected hr %#x.\n", hr); + ok(rel3 == NULL, "Expected null pointer.\n"); + + ret = TRUE; + hr = IOpcRelationshipSet_RelationshipExists(rels, id, &ret); + ok(SUCCEEDED(hr), "Unexpected hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + CoTaskMemFree(id); + + hr = IOpcRelationship_GetTargetUri(rel, &uri); + ok(SUCCEEDED(hr), "Failed to get target uri, hr %#x.\n", hr); + ok(uri == target_uri, "Unexpected uri.\n"); + IUri_Release(uri); + + hr = IOpcRelationship_GetTargetMode(rel, &mode); + ok(SUCCEEDED(hr), "Failed to get target mode, hr %#x.\n", hr); + ok(mode == OPC_URI_TARGET_MODE_INTERNAL, "Unexpected mode %d.\n", mode); + + /* Source uri */ + hr = IOpcFactory_CreatePackageRootUri(factory, &source_uri); + ok(SUCCEEDED(hr), "Failed to create root uri, hr %#x.\n", hr); + + hr = IOpcFactory_CreatePackageRootUri(factory, &source_uri2); + ok(SUCCEEDED(hr), "Failed to create root uri, hr %#x.\n", hr); + ok(source_uri != source_uri2, "Unexpected uri instance.\n"); + + IOpcUri_Release(source_uri); + IOpcUri_Release(source_uri2); + + hr = IOpcRelationship_GetSourceUri(rel, &source_uri); + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + + hr = IOpcUri_QueryInterface(source_uri, &IID_IOpcPartUri, (void **)&unk); + ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); + + str = NULL; + hr = IOpcUri_GetRawUri(source_uri, &str); + ok(SUCCEEDED(hr), "Failed to get raw uri, hr %#x.\n", hr); + ok(!lstrcmpW(rootW, str), "Unexpected uri %s.\n", wine_dbgstr_w(str)); + SysFreeString(str); + + hr = IOpcRelationship_GetSourceUri(rel2, &source_uri2); + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + ok(source_uri2 == source_uri, "Unexpected source uri.\n"); + + IOpcUri_Release(source_uri2); + IOpcUri_Release(source_uri); + + IOpcRelationship_Release(rel2); + IOpcRelationship_Release(rel); + + IOpcRelationshipSet_Release(rels); + + IUri_Release(target_uri); + IUri_Release(target_uri2); + IOpcPackage_Release(package); + IOpcFactory_Release(factory); +} + +static WCHAR *strdupAtoW(const char *str) +{ + WCHAR *ret = NULL; + DWORD len; + + if (!str) return ret; + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = heap_alloc(len * sizeof(WCHAR)); + if (ret) + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + return ret; +} + +static void test_rel_part_uri(void) +{ + static const struct + { + const char *uri; + const char *rel_uri; + HRESULT hr; + } rel_part_uri_tests[] = + { + { "/uri", "/_rels/uri.rels" }, + { "/path/uri", "/path/_rels/uri.rels" }, + { "path/uri", "/path/_rels/uri.rels" }, + { "../path/uri", "/path/_rels/uri.rels" }, + { "../../path/uri", "/path/_rels/uri.rels" }, + { "/uri.ext", "/_rels/uri.ext.rels" }, + { "/", "/_rels/.rels" }, + { "uri", "/_rels/uri.rels" }, + { "/path/../uri", "/_rels/uri.rels" }, + { "/path/path/../../uri", "/_rels/uri.rels" }, + { "/_rels/uri.ext.rels", "", OPC_E_NONCONFORMING_URI }, + }; + static const struct + { + const char *uri; + BOOL ret; + } is_rel_part_tests[] = + { + { "/uri", FALSE }, + { "uri", FALSE }, + { "/_rels/uri", FALSE }, + { "/_rels/uri/uri", FALSE }, + { "/_rels/uri/uri.rels", FALSE }, + { "/uri/uri.rels", FALSE }, + { "/uri/_rels/uri.rels", TRUE }, + { "/_rels/.rels", TRUE }, + }; + static const WCHAR testuriW[] = {'/','u','r','i',0}; + IOpcPartUri *part_uri; + IOpcFactory *factory; + IOpcUri *source_uri; + unsigned int i; + WCHAR *uriW; + HRESULT hr; + + factory = create_factory(); + + hr = IOpcFactory_CreatePartUri(factory, testuriW, &part_uri); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + hr = IOpcPartUri_GetRelationshipsPartUri(part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartUri_IsRelationshipsPartUri(part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartUri_GetSourceUri(part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + source_uri = (void *)0xdeadbeef; + hr = IOpcPartUri_GetSourceUri(part_uri, &source_uri); + ok(hr == OPC_E_RELATIONSHIP_URI_REQUIRED, "Unexpected hr %#x.\n", hr); + ok(source_uri == NULL, "Expected null uri.\n"); + + IOpcPartUri_Release(part_uri); + + for (i = 0; i < ARRAY_SIZE(rel_part_uri_tests); ++i) + { + BOOL is_root = FALSE; + IOpcPartUri *rel_uri; + IOpcUri *part_uri; + WCHAR *rel_uriW; + + uriW = strdupAtoW(rel_part_uri_tests[i].uri); + rel_uriW = strdupAtoW(rel_part_uri_tests[i].rel_uri); + + if (!strcmp(rel_part_uri_tests[i].uri, "/")) + { + hr = IOpcFactory_CreatePackageRootUri(factory, &part_uri); + is_root = TRUE; + } + else + hr = IOpcFactory_CreatePartUri(factory, uriW, (IOpcPartUri **)&part_uri); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + rel_uri = (void *)0xdeadbeef; + hr = IOpcUri_GetRelationshipsPartUri(part_uri, &rel_uri); + if (SUCCEEDED(hr)) + { + IOpcPartUri *rel_uri2; + IOpcUri *source_uri2; + IUnknown *unk = NULL; + BOOL ret; + BSTR str; + + hr = IOpcPartUri_GetSourceUri(rel_uri, &source_uri); + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + hr = IOpcPartUri_GetSourceUri(rel_uri, &source_uri2); + ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr); + ok(source_uri != source_uri2, "Unexpected instance.\n"); + + hr = IOpcUri_IsEqual(source_uri, NULL, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = 123; + hr = IOpcUri_IsEqual(source_uri, NULL, &ret); + ok(is_root ? hr == E_POINTER : hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(is_root ? ret == 123 : !ret, "Unexpected result.\n"); + + ret = FALSE; + hr = IOpcUri_IsEqual(source_uri, (IUri *)source_uri2, &ret); + ok(SUCCEEDED(hr), "IsEqual failed, hr %#x.\n", hr); + ok(ret, "Expected equal uris.\n"); + + hr = IOpcUri_QueryInterface(source_uri, &IID_IOpcPartUri, (void **)&unk); + ok(hr == (is_root ? E_NOINTERFACE : S_OK), "Unexpected hr %#x, %s.\n", hr, rel_part_uri_tests[i].uri); + if (unk) + IUnknown_Release(unk); + + IOpcUri_Release(source_uri2); + IOpcUri_Release(source_uri); + + hr = IOpcUri_GetRelationshipsPartUri(part_uri, &rel_uri2); + ok(SUCCEEDED(hr), "Failed to get rels part uri, hr %#x.\n", hr); + ok(rel_uri2 != rel_uri, "Unexpected instance.\n"); + IOpcPartUri_Release(rel_uri2); + + hr = IOpcPartUri_GetRawUri(rel_uri, &str); + ok(SUCCEEDED(hr), "Failed to get rel uri, hr %#x.\n", hr); + todo_wine_if(i == 3 || i == 4 || i == 8 || i == 9) + ok(!lstrcmpW(str, rel_uriW), "%u: unexpected rel uri %s, expected %s.\n", i, wine_dbgstr_w(str), + wine_dbgstr_w(rel_uriW)); + SysFreeString(str); + + IOpcPartUri_Release(rel_uri); + } + else + { + ok(hr == rel_part_uri_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr); + ok(rel_uri == NULL, "%u: unexpected out pointer.\n", i); + } + + heap_free(uriW); + heap_free(rel_uriW); + + IOpcUri_Release(part_uri); + } + + for (i = 0; i < ARRAY_SIZE(is_rel_part_tests); ++i) + { + IOpcPartUri *part_uri; + BOOL ret; + + uriW = strdupAtoW(is_rel_part_tests[i].uri); + + hr = IOpcFactory_CreatePartUri(factory, uriW, &part_uri); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + ret = 123; + hr = IOpcPartUri_IsRelationshipsPartUri(part_uri, &ret); + ok(SUCCEEDED(hr), "Unexpected hr %#x.\n", hr); + ok(ret == is_rel_part_tests[i].ret, "%u: unexpected result %d.\n", i, ret); + + heap_free(uriW); + + IOpcPartUri_Release(part_uri); + } + + IOpcFactory_Release(factory); +} + +static void test_part_enumerator(void) +{ + static const WCHAR typeW[] = {'t','y','p','e','/','s','u','b','t','y','p','e',0}; + static const WCHAR uriW[] = {'/','u','r','i',0}; + IOpcPartEnumerator *partenum, *partenum2; + IOpcPart *part, *part2; + IOpcPartUri *part_uri; + IOpcPackage *package; + IOpcFactory *factory; + IOpcPartSet *parts; + HRESULT hr; + BOOL ret; + + factory = create_factory(); + + hr = IOpcFactory_CreatePackage(factory, &package); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr); + if (FAILED(hr)) + { + IOpcFactory_Release(factory); + return; + } + + hr = IOpcPackage_GetPartSet(package, &parts); + ok(SUCCEEDED(hr), "Failed to get part set, hr %#x.\n", hr); + + hr = IOpcPartSet_GetEnumerator(parts, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartSet_GetEnumerator(parts, &partenum); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + + hr = IOpcPartSet_GetEnumerator(parts, &partenum2); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + ok(partenum != partenum2, "Unexpected instance.\n"); + IOpcPartEnumerator_Release(partenum2); + + hr = IOpcPartEnumerator_GetCurrent(partenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartEnumerator_GetCurrent(partenum, &part); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartEnumerator_MoveNext(partenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = TRUE; + hr = IOpcPartEnumerator_MoveNext(partenum, &ret); + ok(hr == S_OK, "Failed to move, hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + ret = TRUE; + hr = IOpcPartEnumerator_MovePrevious(partenum, &ret); + ok(hr == S_OK, "Failed to move, hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + hr = IOpcFactory_CreatePartUri(factory, uriW, &part_uri); + ok(SUCCEEDED(hr), "Failed to create part uri, hr %#x.\n", hr); + + hr = IOpcPartSet_CreatePart(parts, part_uri, typeW, OPC_COMPRESSION_NONE, &part); + ok(SUCCEEDED(hr), "Failed to create a part, hr %#x.\n", hr); + IOpcPartUri_Release(part_uri); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected instance.\n"); + + hr = IOpcPartEnumerator_MoveNext(partenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = 123; + hr = IOpcPartEnumerator_MoveNext(partenum, &ret); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_MovePrevious(partenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = 123; + hr = IOpcPartEnumerator_MovePrevious(partenum, &ret); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_Clone(partenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + partenum2 = (void *)0xdeadbeef; + hr = IOpcPartEnumerator_Clone(partenum, &partenum2); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(partenum2 == NULL, "Unexpected instance.\n"); + + IOpcPartEnumerator_Release(partenum); + + hr = IOpcPartSet_GetEnumerator(parts, &partenum); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected instance.\n"); + + hr = IOpcPartEnumerator_MoveNext(partenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(part2 == part, "Unexpected instance.\n"); + IOpcPart_Release(part2); + + hr = IOpcPartEnumerator_MoveNext(partenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + part2 = (void *)0xdeadbeef; + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + ok(part2 == NULL, "Unexpected instance.\n"); + + hr = IOpcPartEnumerator_MovePrevious(partenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(part2 == part, "Unexpected instance.\n"); + IOpcPart_Release(part2); + + hr = IOpcPartEnumerator_MovePrevious(partenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + hr = IOpcPartEnumerator_Clone(partenum, &partenum2); + ok(SUCCEEDED(hr), "Clone failed, hr %#x.\n", hr); + + hr = IOpcPartEnumerator_MoveNext(partenum2, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcPartEnumerator_GetCurrent(partenum2, &part2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IOpcPart_Release(part2); + + hr = IOpcPartEnumerator_GetCurrent(partenum, &part2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + IOpcPartEnumerator_Release(partenum2); + + IOpcPartEnumerator_Release(partenum); + + IOpcPart_Release(part); + + IOpcPartSet_Release(parts); + + IOpcPackage_Release(package); + IOpcFactory_Release(factory); +} + +static void test_rels_enumerator(void) +{ + static const WCHAR typeW[] = {'t','y','p','e','/','s','u','b','t','y','p','e',0}; + static const WCHAR targetW[] = {'t','a','r','g','e','t',0}; + IOpcRelationshipEnumerator *relsenum, *relsenum2; + IOpcRelationship *rel, *rel2; + IOpcPackage *package; + IOpcFactory *factory; + IOpcRelationshipSet *rels; + IUri *target_uri; + HRESULT hr; + BOOL ret; + + factory = create_factory(); + + hr = IOpcFactory_CreatePackage(factory, &package); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr); + if (FAILED(hr)) + { + IOpcFactory_Release(factory); + return; + } + + hr = IOpcPackage_GetRelationshipSet(package, &rels); + ok(SUCCEEDED(hr), "Failed to get part set, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_GetEnumerator(rels, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcRelationshipSet_GetEnumerator(rels, &relsenum); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_GetEnumerator(rels, &relsenum2); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + ok(relsenum != relsenum2, "Unexpected instance.\n"); + IOpcRelationshipEnumerator_Release(relsenum2); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = TRUE; + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, &ret); + ok(hr == S_OK, "Failed to move, hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + ret = TRUE; + hr = IOpcRelationshipEnumerator_MovePrevious(relsenum, &ret); + ok(hr == S_OK, "Failed to move, hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + hr = CreateUri(targetW, Uri_CREATE_ALLOW_RELATIVE, 0, &target_uri); + ok(SUCCEEDED(hr), "Failed to create target uri, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); + ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); + + IUri_Release(target_uri); + + rel2 = (void *)0xdeadbeef; + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(rel2 == NULL, "Unexpected instance.\n"); + + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = 123; + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, &ret); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_MovePrevious(relsenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + ret = 123; + hr = IOpcRelationshipEnumerator_MovePrevious(relsenum, &ret); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_Clone(relsenum, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + relsenum2 = (void *)0xdeadbeef; + hr = IOpcRelationshipEnumerator_Clone(relsenum, &relsenum2); + ok(hr == OPC_E_ENUM_COLLECTION_CHANGED, "Unexpected hr %#x.\n", hr); + ok(relsenum2 == NULL, "Unexpected instance.\n"); + + IOpcRelationshipEnumerator_Release(relsenum); + + hr = IOpcRelationshipSet_GetEnumerator(rels, &relsenum); + ok(SUCCEEDED(hr), "Failed to get enumerator, hr %#x.\n", hr); + + rel2 = (void *)0xdeadbeef; + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + ok(rel2 == NULL, "Unexpected instance.\n"); + + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(rel2 == rel, "Unexpected instance.\n"); + IOpcRelationship_Release(rel2); + + hr = IOpcRelationshipEnumerator_MoveNext(relsenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + rel2 = (void *)0xdeadbeef; + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + ok(rel2 == NULL, "Unexpected instance.\n"); + + hr = IOpcRelationshipEnumerator_MovePrevious(relsenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(rel2 == rel, "Unexpected instance.\n"); + IOpcRelationship_Release(rel2); + + hr = IOpcRelationshipEnumerator_MovePrevious(relsenum, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!ret, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + hr = IOpcRelationshipEnumerator_Clone(relsenum, &relsenum2); + ok(SUCCEEDED(hr), "Clone failed, hr %#x.\n", hr); + + hr = IOpcRelationshipEnumerator_MoveNext(relsenum2, &ret); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(ret, "Unexpected result %d.\n", ret); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum2, &rel2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IOpcRelationship_Release(rel2); + + hr = IOpcRelationshipEnumerator_GetCurrent(relsenum, &rel2); + ok(hr == OPC_E_ENUM_INVALID_POSITION, "Unexpected hr %#x.\n", hr); + + IOpcRelationshipEnumerator_Release(relsenum2); + + IOpcRelationshipEnumerator_Release(relsenum); + + IOpcRelationship_Release(rel); + + IOpcRelationshipSet_Release(rels); + + IOpcPackage_Release(package); + IOpcFactory_Release(factory); +} + +static void test_relative_uri(void) +{ + static const struct + { + const char *part; + const char *combined; + const char *relative; + const char *relative_broken; + } + relative_uri_tests[] = + { + { "/", "/path/path2", "path/path2", "/path/path2" }, + { "/", "/path", "path", "/path" }, + { "/path/path2", "/path/path2/path3", "path2/path3" }, + { "/path/path2", "/path3", "../path3" }, + { "/path", "/path", "" }, + { "/path", "../path", "" }, + { "/path2", "/path", "path" }, + { "../path", "/path", "" }, + { "../../path", "/path", "" }, + }; + IOpcFactory *factory; + unsigned int i; + + factory = create_factory(); + + for (i = 0; i < ARRAY_SIZE(relative_uri_tests); ++i) + { + WCHAR *uriW, *combinedW, *relativeW, *relative_broken_W; + IOpcPartUri *combined_uri; + IUri *relative_uri; + IOpcUri *part_uri; + IUnknown *unk; + HRESULT hr; + BSTR str; + + uriW = strdupAtoW(relative_uri_tests[i].part); + combinedW = strdupAtoW(relative_uri_tests[i].combined); + relativeW = strdupAtoW(relative_uri_tests[i].relative); + relative_broken_W = strdupAtoW(relative_uri_tests[i].relative_broken); + + if (!strcmp(relative_uri_tests[i].part, "/")) + hr = IOpcFactory_CreatePackageRootUri(factory, &part_uri); + else + hr = IOpcFactory_CreatePartUri(factory, uriW, (IOpcPartUri **)&part_uri); + ok(SUCCEEDED(hr), "%u: failed to create part uri, hr %#x.\n", i, hr); + + hr = IOpcFactory_CreatePartUri(factory, combinedW, &combined_uri); + ok(SUCCEEDED(hr), "%u: failed to create part uri, hr %#x.\n", i, hr); + + hr = IOpcUri_GetRelativeUri(part_uri, combined_uri, &relative_uri); + todo_wine + ok(SUCCEEDED(hr), "%u: failed t oget relative uri, hr %#x.\n", i, hr); + + if (SUCCEEDED(hr)) + { + hr = IUri_QueryInterface(relative_uri, &IID_IOpcUri, (void **)&unk); + ok(hr == E_NOINTERFACE, "%u: unexpected hr %#x.\n", i, hr); + + hr = IUri_GetRawUri(relative_uri, &str); + ok(SUCCEEDED(hr), "%u: failed to get raw uri, hr %#x.\n", i, hr); + ok(!lstrcmpW(str, relativeW) || broken(relative_broken_W && !lstrcmpW(str, relative_broken_W)), + "%u: unexpected relative uri %s.\n", i, wine_dbgstr_w(str)); + SysFreeString(str); + + IUri_Release(relative_uri); + } + IOpcUri_Release(part_uri); + IOpcPartUri_Release(combined_uri); + + heap_free(uriW); + heap_free(combinedW); + heap_free(relativeW); + heap_free(relative_broken_W); + } + + IOpcFactory_Release(factory); +} + +static void test_combine_uri(void) +{ + static const struct + { + const char *uri; + const char *relative; + const char *combined; + } + combine_tests[] = + { + { "/", "path", "/path" }, + { "/path1", "path2", "/path2" }, + { "/path1", "../path2", "/path2" }, + { "/path1/../path2", "path3", "/path3" }, + }; + IOpcFactory *factory; + unsigned int i; + + factory = create_factory(); + + for (i = 0; i < ARRAY_SIZE(combine_tests); ++i) + { + WCHAR *uriW, *relativeW, *combinedW; + IOpcPartUri *combined_uri; + IUri *relative_uri; + IOpcUri *uri; + HRESULT hr; + BSTR str; + + uriW = strdupAtoW(combine_tests[i].uri); + relativeW = strdupAtoW(combine_tests[i].relative); + combinedW = strdupAtoW(combine_tests[i].combined); + + if (!strcmp(combine_tests[i].uri, "/")) + hr = IOpcFactory_CreatePackageRootUri(factory, &uri); + else + hr = IOpcFactory_CreatePartUri(factory, uriW, (IOpcPartUri **)&uri); + ok(SUCCEEDED(hr), "%u: failed to create uri, hr %#x.\n", i, hr); + + hr = CreateUri(relativeW, Uri_CREATE_ALLOW_RELATIVE, 0, &relative_uri); + ok(SUCCEEDED(hr), "%u: failed to create relative uri, hr %#x.\n", i, hr); + + combined_uri = (void *)0xdeadbeef; + hr = IOpcUri_CombinePartUri(uri, NULL, &combined_uri); + ok(hr == E_POINTER, "%u: failed to combine uris, hr %#x.\n", i, hr); + ok(!combined_uri, "Unexpected instance.\n"); + + hr = IOpcUri_CombinePartUri(uri, relative_uri, NULL); + ok(hr == E_POINTER, "%u: failed to combine uris, hr %#x.\n", i, hr); + + hr = IOpcUri_CombinePartUri(uri, relative_uri, &combined_uri); + ok(SUCCEEDED(hr), "%u: failed to combine uris, hr %#x.\n", i, hr); + + hr = IOpcPartUri_GetRawUri(combined_uri, &str); + ok(SUCCEEDED(hr), "%u: failed to get raw uri, hr %#x.\n", i, hr); + todo_wine_if(i == 2 || i == 3) + ok(!lstrcmpW(str, combinedW), "%u: unexpected uri %s.\n", i, wine_dbgstr_w(str)); + SysFreeString(str); + + IOpcPartUri_Release(combined_uri); + + heap_free(uriW); + heap_free(relativeW); + heap_free(combinedW); + + IOpcUri_Release(uri); + IUri_Release(relative_uri); + } + + IOpcFactory_Release(factory); +} + +static void test_create_part_uri(void) +{ + static const struct + { + const char *input; + const char *raw_uri; + } + create_part_uri_tests[] = + { + { "path", "/path" }, + { "../path", "/path" }, + { "../../path", "/path" }, + { "/path", "/path" }, + { "/path1/path2/path3/../path4", "/path1/path2/path4" }, + }; + IOpcFactory *factory; + unsigned int i; + HRESULT hr; + + factory = create_factory(); + + for (i = 0; i < ARRAY_SIZE(create_part_uri_tests); ++i) + { + IOpcPartUri *part_uri; + WCHAR *inputW, *rawW; + IUri *uri; + BSTR str; + BOOL ret; + + inputW = strdupAtoW(create_part_uri_tests[i].input); + rawW = strdupAtoW(create_part_uri_tests[i].raw_uri); + + hr = IOpcFactory_CreatePartUri(factory, inputW, &part_uri); + ok(SUCCEEDED(hr), "%u: failed to create part uri, hr %#x.\n", i, hr); + + hr = IOpcPartUri_GetRawUri(part_uri, &str); + ok(SUCCEEDED(hr), "Failed to get raw uri, hr %#x.\n", hr); + todo_wine_if(i == 1 || i == 2 || i == 4) + ok(!lstrcmpW(str, rawW), "%u: unexpected raw uri %s.\n", i, wine_dbgstr_w(str)); + SysFreeString(str); + + hr = CreateUri(rawW, Uri_CREATE_ALLOW_RELATIVE, 0, &uri); + ok(SUCCEEDED(hr), "Failed to create uri, hr %#x.\n", hr); + + ret = FALSE; + hr = IOpcPartUri_IsEqual(part_uri, uri, &ret); + ok(SUCCEEDED(hr), "IsEqual failed, hr %#x.\n", hr); + todo_wine_if(i == 1 || i == 2 || i == 4) + ok(!!ret, "%u: unexpected result %d.\n", i, ret); + + IOpcPartUri_Release(part_uri); + IUri_Release(uri); + + heap_free(inputW); + heap_free(rawW); + } + + IOpcFactory_Release(factory); +} + +static HRESULT WINAPI custom_package_QueryInterface(IOpcPackage *iface, REFIID iid, void **out) +{ + if (IsEqualIID(iid, &IID_IOpcPackage) || IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcPackage_AddRef(iface); + return S_OK; + } + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI custom_package_AddRef(IOpcPackage *iface) +{ + return 2; +} + +static ULONG WINAPI custom_package_Release(IOpcPackage *iface) +{ + return 1; +} + +static HRESULT WINAPI custom_package_GetPartSet(IOpcPackage *iface, IOpcPartSet **part_set) +{ + return 0x80000001; +} + +static HRESULT WINAPI custom_package_GetRelationshipSet(IOpcPackage *iface, IOpcRelationshipSet **relationship_set) +{ + return 0x80000001; +} + +static const IOpcPackageVtbl custom_package_vtbl = +{ + custom_package_QueryInterface, + custom_package_AddRef, + custom_package_Release, + custom_package_GetPartSet, + custom_package_GetRelationshipSet, +}; + +static void test_write_package(void) +{ + IOpcPackage custom_package = { &custom_package_vtbl }; + IOpcFactory *factory; + IOpcPackage *package; + IStream *stream; + HRESULT hr; + + factory = create_factory(); + + hr = IOpcFactory_CreatePackage(factory, &package); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr); + if (FAILED(hr)) + { + IOpcFactory_Release(factory); + return; + } + + hr = IOpcFactory_WritePackageToStream(factory, NULL, OPC_WRITE_FORCE_ZIP32, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(SUCCEEDED(hr), "Failed to create a stream, hr %#x.\n", hr); + + hr = IOpcFactory_WritePackageToStream(factory, NULL, OPC_WRITE_FORCE_ZIP32, stream); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IOpcFactory_WritePackageToStream(factory, &custom_package, OPC_WRITE_FORCE_ZIP32, stream); + ok(hr == 0x80000001, "Unexpected hr %#x.\n", hr); + + IStream_Release(stream); + + IOpcFactory_Release(factory); + IOpcPackage_Release(package); +} + +START_TEST(opcservices) +{ + IOpcFactory *factory; + HRESULT hr; + + hr = CoInitialize(NULL); + ok(SUCCEEDED(hr), "Failed to initialize COM, hr %#x.\n", hr); + + if (!(factory = create_factory())) { + win_skip("Failed to create IOpcFactory factory.\n"); + CoUninitialize(); + return; + } + + test_package(); + test_file_stream(); + test_relationship(); + test_rel_part_uri(); + test_part_enumerator(); + test_rels_enumerator(); + test_relative_uri(); + test_combine_uri(); + test_create_part_uri(); + test_write_package(); + + IOpcFactory_Release(factory); + + CoUninitialize(); +} diff --git a/wrappers/new-dlls/opcservices/uri.c b/wrappers/new-dlls/opcservices/uri.c new file mode 100644 index 00000000000..5cba14aa78b --- /dev/null +++ b/wrappers/new-dlls/opcservices/uri.c @@ -0,0 +1,609 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include "windef.h" +#include "winbase.h" + +#include "wine/debug.h" + +#include "opc_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msopc); + +static inline struct opc_uri *impl_from_IOpcPartUri(IOpcPartUri *iface) +{ + return CONTAINING_RECORD(iface, struct opc_uri, IOpcPartUri_iface); +} + +static HRESULT opc_source_uri_create(struct opc_uri *uri, IOpcUri **out); + +static HRESULT WINAPI opc_uri_QueryInterface(IOpcPartUri *iface, REFIID iid, void **out) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if ((uri->is_part_uri && IsEqualIID(iid, &IID_IOpcPartUri)) || + IsEqualIID(iid, &IID_IOpcUri) || + IsEqualIID(iid, &IID_IUri) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcPartUri_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_uri_AddRef(IOpcPartUri *iface) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + ULONG refcount = InterlockedIncrement(&uri->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI opc_uri_Release(IOpcPartUri *iface) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + ULONG refcount = InterlockedDecrement(&uri->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + if (uri->rels_part_uri) + IUri_Release(uri->rels_part_uri); + if (uri->source_uri) + IOpcPartUri_Release(&uri->source_uri->IOpcPartUri_iface); + IUri_Release(uri->uri); + heap_free(uri); + } + + return refcount; +} + +static HRESULT WINAPI opc_uri_GetPropertyBSTR(IOpcPartUri *iface, Uri_PROPERTY property, + BSTR *value, DWORD flags) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, property %d, value %p, flags %#x.\n", iface, property, value, flags); + + return IUri_GetPropertyBSTR(uri->uri, property, value, flags); +} + +static HRESULT WINAPI opc_uri_GetPropertyLength(IOpcPartUri *iface, Uri_PROPERTY property, + DWORD *length, DWORD flags) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, property %d, length %p, flags %#x.\n", iface, property, length, flags); + + return IUri_GetPropertyLength(uri->uri, property, length, flags); +} + +static HRESULT WINAPI opc_uri_GetPropertyDWORD(IOpcPartUri *iface, Uri_PROPERTY property, + DWORD *value, DWORD flags) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, property %d, value %p, flags %#x.\n", iface, property, value, flags); + + return IUri_GetPropertyDWORD(uri->uri, property, value, flags); +} + +static HRESULT WINAPI opc_uri_HasProperty(IOpcPartUri *iface, Uri_PROPERTY property, + BOOL *has_property) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, property %d, has_property %p.\n", iface, property, has_property); + + return IUri_HasProperty(uri->uri, property, has_property); +} + +static HRESULT WINAPI opc_uri_GetAbsoluteUri(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetAbsoluteUri(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetAuthority(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetAuthority(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetDisplayUri(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetDisplayUri(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetDomain(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetDomain(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetExtension(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetExtension(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetFragment(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetFragment(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetHost(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetHost(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetPassword(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetPassword(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetPath(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetPath(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetPathAndQuery(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetPathAndQuery(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetQuery(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetQuery(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetRawUri(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetRawUri(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetSchemeName(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetSchemeName(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetUserInfo(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetUserInfo(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetUserName(IOpcPartUri *iface, BSTR *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetUserName(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetHostType(IOpcPartUri *iface, DWORD *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetHostType(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetPort(IOpcPartUri *iface, DWORD *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetPort(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetScheme(IOpcPartUri *iface, DWORD *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetScheme(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetZone(IOpcPartUri *iface, DWORD *value) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return IUri_GetZone(uri->uri, value); +} + +static HRESULT WINAPI opc_uri_GetProperties(IOpcPartUri *iface, DWORD *flags) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, flags %p.\n", iface, flags); + + return IUri_GetProperties(uri->uri, flags); +} + +static HRESULT WINAPI opc_uri_IsEqual(IOpcPartUri *iface, IUri *comparand, BOOL *is_equal) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, comparand %p, is_equal %p.\n", iface, comparand, is_equal); + + if (!is_equal) + return E_POINTER; + + if (!comparand) + { + if (uri->is_part_uri) + { + *is_equal = FALSE; + return S_OK; + } + + return E_POINTER; + } + + return IUri_IsEqual(comparand, uri->uri, is_equal); +} + +static HRESULT WINAPI opc_uri_GetRelationshipsPartUri(IOpcPartUri *iface, IOpcPartUri **part_uri) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, part_uri %p.\n", iface, part_uri); + + if (!part_uri) + return E_POINTER; + + if (!uri->rels_part_uri) + { + *part_uri = NULL; + return OPC_E_NONCONFORMING_URI; + } + + return opc_part_uri_create(uri->rels_part_uri, uri, part_uri); +} + +static HRESULT WINAPI opc_uri_GetRelativeUri(IOpcPartUri *iface, IOpcPartUri *part_uri, + IUri **relative_uri) +{ + FIXME("iface %p, part_uri %p, relative_uri %p stub!\n", iface, part_uri, relative_uri); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_uri_CombinePartUri(IOpcPartUri *iface, IUri *relative_uri, IOpcPartUri **combined) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + IUri *combined_uri; + HRESULT hr; + + TRACE("iface %p, relative_uri %p, combined %p.\n", iface, relative_uri, combined); + + if (!combined) + return E_POINTER; + + *combined = NULL; + + if (!relative_uri) + return E_POINTER; + + if (FAILED(hr = CoInternetCombineIUri(uri->uri, relative_uri, 0, &combined_uri, 0))) + return hr; + + hr = opc_part_uri_create(combined_uri, NULL, combined); + IUri_Release(combined_uri); + return hr; +} + +static HRESULT WINAPI opc_uri_ComparePartUri(IOpcPartUri *iface, IOpcPartUri *part_uri, + INT32 *result) +{ + FIXME("iface %p, part_uri %p, result %p stub!\n", iface, part_uri, result); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_uri_GetSourceUri(IOpcPartUri *iface, IOpcUri **source_uri) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, source_uri %p.\n", iface, source_uri); + + return opc_source_uri_create(uri, source_uri); +} + +static HRESULT WINAPI opc_uri_IsRelationshipsPartUri(IOpcPartUri *iface, BOOL *result) +{ + struct opc_uri *uri = impl_from_IOpcPartUri(iface); + + TRACE("iface %p, result %p.\n", iface, result); + + if (!result) + return E_POINTER; + + *result = !uri->rels_part_uri; + + return S_OK; +} + +static const IOpcPartUriVtbl opc_part_uri_vtbl = +{ + opc_uri_QueryInterface, + opc_uri_AddRef, + opc_uri_Release, + opc_uri_GetPropertyBSTR, + opc_uri_GetPropertyLength, + opc_uri_GetPropertyDWORD, + opc_uri_HasProperty, + opc_uri_GetAbsoluteUri, + opc_uri_GetAuthority, + opc_uri_GetDisplayUri, + opc_uri_GetDomain, + opc_uri_GetExtension, + opc_uri_GetFragment, + opc_uri_GetHost, + opc_uri_GetPassword, + opc_uri_GetPath, + opc_uri_GetPathAndQuery, + opc_uri_GetQuery, + opc_uri_GetRawUri, + opc_uri_GetSchemeName, + opc_uri_GetUserInfo, + opc_uri_GetUserName, + opc_uri_GetHostType, + opc_uri_GetPort, + opc_uri_GetScheme, + opc_uri_GetZone, + opc_uri_GetProperties, + opc_uri_IsEqual, + opc_uri_GetRelationshipsPartUri, + opc_uri_GetRelativeUri, + opc_uri_CombinePartUri, + opc_uri_ComparePartUri, + opc_uri_GetSourceUri, + opc_uri_IsRelationshipsPartUri, +}; + +static IUri *opc_part_uri_get_rels_uri(IUri *uri) +{ + static const WCHAR relsdirW[] = L"/_rels"; + static const WCHAR relsextW[] = L".rels"; + WCHAR *start = NULL, *end, *ret; + IUri *rels_uri; + HRESULT hr; + DWORD len; + BSTR path; + + if (FAILED(IUri_GetPath(uri, &path))) + return NULL; + + if (FAILED(IUri_GetPropertyLength(uri, Uri_PROPERTY_PATH, &len, 0))) + { + SysFreeString(path); + return NULL; + } + + end = wcsrchr(path, '/'); + if (end && end >= path + ARRAY_SIZE(relsdirW) - 1) + start = end - ARRAY_SIZE(relsdirW) + 1; + if (!start) + start = end; + + /* Test if it's already relationships uri. */ + if (len > ARRAY_SIZE(relsextW)) + { + if (!wcscmp(path + len - ARRAY_SIZE(relsextW) + 1, relsextW)) + { + if (start && !memcmp(start, relsdirW, ARRAY_SIZE(relsdirW) - sizeof(WCHAR))) + { + SysFreeString(path); + return NULL; + } + } + } + + ret = heap_alloc((len + ARRAY_SIZE(relsextW) + ARRAY_SIZE(relsdirW)) * sizeof(WCHAR)); + if (!ret) + { + SysFreeString(path); + return NULL; + } + ret[0] = 0; + + if (start != path) + { + memcpy(ret, path, (start - path) * sizeof(WCHAR)); + ret[start - path] = 0; + } + + lstrcatW(ret, relsdirW); + lstrcatW(ret, end); + lstrcatW(ret, relsextW); + + if (FAILED(hr = CreateUri(ret, Uri_CREATE_ALLOW_RELATIVE, 0, &rels_uri))) + WARN("Failed to create rels uri, hr %#x.\n", hr); + heap_free(ret); + SysFreeString(path); + + return rels_uri; +} + +static HRESULT opc_part_uri_init(struct opc_uri *object, struct opc_uri *source_uri, BOOL is_part_uri, IUri *uri) +{ + object->IOpcPartUri_iface.lpVtbl = &opc_part_uri_vtbl; + object->refcount = 1; + object->is_part_uri = is_part_uri; + object->uri = uri; + IUri_AddRef(object->uri); + object->rels_part_uri = opc_part_uri_get_rels_uri(object->uri); + object->source_uri = source_uri; + if (object->source_uri) + IOpcPartUri_AddRef(&object->source_uri->IOpcPartUri_iface); + + return S_OK; +} + +static HRESULT opc_source_uri_create(struct opc_uri *uri, IOpcUri **out) +{ + struct opc_uri *obj; + HRESULT hr; + + if (!out) + return E_POINTER; + + *out = NULL; + + if (!uri->source_uri) + return OPC_E_RELATIONSHIP_URI_REQUIRED; + + if (!(obj = heap_alloc_zero(sizeof(*obj)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = opc_part_uri_init(obj, NULL, uri->source_uri->is_part_uri, uri->source_uri->uri))) + { + WARN("Failed to init part uri, hr %#x.\n", hr); + heap_free(obj); + return hr; + } + + *out = (IOpcUri *)&obj->IOpcPartUri_iface; + + TRACE("Created source uri %p.\n", *out); + + return S_OK; +} + +HRESULT opc_part_uri_create(IUri *uri, struct opc_uri *source_uri, IOpcPartUri **out) +{ + struct opc_uri *obj; + HRESULT hr; + + if (!(obj = heap_alloc_zero(sizeof(*obj)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = opc_part_uri_init(obj, source_uri, TRUE, uri))) + { + WARN("Failed to init part uri, hr %#x.\n", hr); + heap_free(obj); + return hr; + } + + *out = &obj->IOpcPartUri_iface; + TRACE("Created part uri %p.\n", *out); + return S_OK; +} + +HRESULT opc_root_uri_create(IOpcUri **out) +{ + struct opc_uri *obj; + HRESULT hr; + IUri *uri; + + *out = NULL; + + if (!(obj = heap_alloc_zero(sizeof(*obj)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = CreateUri(L"/", Uri_CREATE_ALLOW_RELATIVE, 0, &uri))) + { + WARN("Failed to create rels uri, hr %#x.\n", hr); + heap_free(obj); + return hr; + } + + hr = opc_part_uri_init(obj, NULL, FALSE, uri); + IUri_Release(uri); + if (FAILED(hr)) + { + WARN("Failed to init uri, hr %#x.\n", hr); + heap_free(uri); + return hr; + } + + *out = (IOpcUri *)&obj->IOpcPartUri_iface; + TRACE("Created part uri %p.\n", *out); + return S_OK; +} diff --git a/wrappers/new-dlls/opcservices/zlib.h b/wrappers/new-dlls/opcservices/zlib.h new file mode 100644 index 00000000000..e72398c2d9c --- /dev/null +++ b/wrappers/new-dlls/opcservices/zlib.h @@ -0,0 +1,162 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + * version 1.2.11, January 15th, 2017 + * + * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * Jean-loup Gailly Mark Adler + * jloup@gzip.org madler@alumni.caltech.edu + */ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "windef.h" + +#undef FAR +#define FAR +#define z_const const + +typedef unsigned char Byte; /* 8 bits */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +typedef Byte FAR Bytef; +typedef void FAR *voidpf; + +typedef char FAR charf; +typedef int FAR intf; + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); +typedef void (*free_func)(voidpf opaque, voidpf address); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field for deflate() */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define MAX_WBITS 15 /* 32K LZ77 window */ +#define MAX_MEM_LEVEL 9 + +extern int inflateInit(z_streamp strm) DECLSPEC_HIDDEN; +extern int inflateInit2(z_streamp strm, int windowBits) DECLSPEC_HIDDEN; +extern int inflate(z_streamp strm, int flush) DECLSPEC_HIDDEN; +extern int inflateEnd(z_streamp strm) DECLSPEC_HIDDEN; + +extern int deflateInit(z_streamp strm, int level) DECLSPEC_HIDDEN; +extern int deflateInit2(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy) DECLSPEC_HIDDEN; +extern int deflate(z_streamp strm, int flush) DECLSPEC_HIDDEN; +extern int deflateEnd(z_streamp strm) DECLSPEC_HIDDEN; + +#endif /* ZLIB_H */ diff --git a/wrappers/new-dlls/prntvpt/Makefile.in b/wrappers/new-dlls/prntvpt/Makefile.in new file mode 100644 index 00000000000..09818bc7b74 --- /dev/null +++ b/wrappers/new-dlls/prntvpt/Makefile.in @@ -0,0 +1,9 @@ +MODULE = prntvpt.dll +IMPORTLIB = prntvpt +IMPORTS = winspool ole32 oleaut32 + +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native + +C_SRCS = \ + main.c \ + ticket.c diff --git a/wrappers/new-dlls/prntvpt/main.c b/wrappers/new-dlls/prntvpt/main.c new file mode 100644 index 00000000000..d6ad0cff46a --- /dev/null +++ b/wrappers/new-dlls/prntvpt/main.c @@ -0,0 +1,110 @@ +/* + * Print Ticket Services Module + * + * Copyright 2014 Jactry Zeng for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winspool.h" +#include "objbase.h" +#include "prntvpt.h" +#include "wine/heap.h" +#include "wine/debug.h" + +#include "prntvpt_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(prntvpt); + +static WCHAR *heap_strdupW(const WCHAR *src) +{ + WCHAR *dst; + size_t len; + if (!src) return NULL; + len = (wcslen(src) + 1) * sizeof(WCHAR); + if ((dst = heap_alloc(len))) memcpy(dst, src, len); + return dst; +} + +HRESULT WINAPI PTReleaseMemory(PVOID mem) +{ + heap_free(mem); + return S_OK; +} + +HRESULT WINAPI PTQuerySchemaVersionSupport(PCWSTR printer, DWORD *version) +{ + FIXME("stub:%s %p\n", debugstr_w(printer), version); + return E_NOTIMPL; +} + +HRESULT WINAPI PTCloseProvider(HPTPROVIDER provider) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + + TRACE("%p\n", provider); + + if (!is_valid_provider(provider)) + return E_HANDLE; + + prov->owner = 0; + heap_free(prov->name); + ClosePrinter(prov->hprn); + heap_free(prov); + + return S_OK; +} + +HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider) +{ + DWORD used_version; + + TRACE("%s, %d, %p\n", debugstr_w(printer), version, provider); + + if (version != 1) return E_INVALIDARG; + + return PTOpenProviderEx(printer, 1, 1, provider, &used_version); +} + +HRESULT WINAPI PTOpenProviderEx(const WCHAR *printer, DWORD max_version, DWORD pref_version, HPTPROVIDER *provider, DWORD *used_version) +{ + struct prn_provider *prov; + + TRACE("%s, %d, %d, %p, %p\n", debugstr_w(printer), max_version, pref_version, provider, used_version); + + if (!max_version || !provider || !used_version) + return E_INVALIDARG; + + prov = heap_alloc(sizeof(*prov)); + if (!prov) return E_OUTOFMEMORY; + + if (!OpenPrinterW((LPWSTR)printer, &prov->hprn, NULL)) + { + heap_free(prov); + return HRESULT_FROM_WIN32(GetLastError()); + } + + prov->name = heap_strdupW(printer); + prov->owner = GetCurrentThreadId(); + *provider = (HPTPROVIDER)prov; + *used_version = 1; + + return S_OK; +} diff --git a/wrappers/new-dlls/prntvpt/prntvpt.spec b/wrappers/new-dlls/prntvpt/prntvpt.spec new file mode 100644 index 00000000000..bc0fe2a88b6 --- /dev/null +++ b/wrappers/new-dlls/prntvpt/prntvpt.spec @@ -0,0 +1,27 @@ +@ stdcall PTQuerySchemaVersionSupport(wstr ptr) +@ stdcall PTOpenProvider(wstr long ptr) +@ stdcall PTOpenProviderEx(wstr long long ptr ptr) +@ stdcall PTCloseProvider(ptr) +@ stub BindPTProviderThunk +@ stdcall PTGetPrintCapabilities(ptr ptr ptr ptr) +@ stdcall PTMergeAndValidatePrintTicket(ptr ptr ptr long ptr ptr) +@ stdcall PTConvertPrintTicketToDevMode(ptr ptr long long ptr ptr ptr) +@ stdcall PTConvertDevModeToPrintTicket(ptr long ptr long ptr) +@ stdcall PTReleaseMemory(ptr) +@ stub ConvertDevModeToPrintTicketThunk2 +@ stub ConvertDevModeToPrintTicketThunk +@ stub ConvertPrintTicketToDevModeThunk2 +@ stub ConvertPrintTicketToDevModeThunk +@ stdcall -private DllCanUnloadNow() +@ stub DllGetClassObject +@ stdcall -private DllMain(long long ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() +@ stub GetDeviceDefaultPrintTicketThunk +@ stub GetDeviceNamespacesThunk +@ stub GetPrintCapabilitiesThunk2 +@ stub GetPrintCapabilitiesThunk +@ stub GetSchemaVersionThunk +@ stub MergeAndValidatePrintTicketThunk2 +@ stub MergeAndValidatePrintTicketThunk +@ stub UnbindPTProviderThunk diff --git a/wrappers/to-synch/sdk/include/psdk/roerrorapi.h b/wrappers/new-dlls/prntvpt/prntvpt_private.h similarity index 67% rename from wrappers/to-synch/sdk/include/psdk/roerrorapi.h rename to wrappers/new-dlls/prntvpt/prntvpt_private.h index dd9c7f16ec0..857b92f2024 100644 --- a/wrappers/to-synch/sdk/include/psdk/roerrorapi.h +++ b/wrappers/new-dlls/prntvpt/prntvpt_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2020 Jacek Caban for CodeWeavers + * Copyright 2019 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,14 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _ROERROR_H -#define _ROERROR_H +struct prn_provider +{ + DWORD owner; + WCHAR *name; + HANDLE hprn; +}; -#include -#include -#include - -HRESULT WINAPI GetRestrictedErrorInfo(IRestrictedErrorInfo **info); -BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknown *language_exception); - -#endif /* _ROERROR_H */ +static inline BOOL is_valid_provider(HPTPROVIDER provider) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + return prov && prov->owner == GetCurrentThreadId(); +} diff --git a/wrappers/new-dlls/prntvpt/tests/Makefile.in b/wrappers/new-dlls/prntvpt/tests/Makefile.in new file mode 100644 index 00000000000..692a134d016 --- /dev/null +++ b/wrappers/new-dlls/prntvpt/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = prntvpt.dll +IMPORTS = prntvpt winspool ole32 + +C_SRCS = \ + prntvpt.c diff --git a/wrappers/new-dlls/prntvpt/tests/prntvpt.c b/wrappers/new-dlls/prntvpt/tests/prntvpt.c new file mode 100644 index 00000000000..55b6f3fdef1 --- /dev/null +++ b/wrappers/new-dlls/prntvpt/tests/prntvpt.c @@ -0,0 +1,148 @@ +/* + * Copyright 2019 Dmitry Timoshkov + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include + +#include +#include +#include +#include +#include +#include + +#include "wine/test.h" + +static WCHAR default_name[256]; + +struct hprov_data +{ + HPTPROVIDER hprov; + HRESULT hr; +}; + +static DWORD WINAPI CloseProvider_proc(void *param) +{ + struct hprov_data *data = param; + + data->hr = PTCloseProvider(data->hprov); + + return 0; +} + +static void test_PTOpenProvider(void) +{ + DWORD tid, i; + HPTPROVIDER hprov; + HRESULT hr; + HANDLE hthread; + struct hprov_data data; + + hr = PTOpenProvider(default_name, 1, &hprov); + ok(hr == S_OK, "got %#x\n", hr); + + data.hprov = hprov; + hthread = CreateThread(NULL, 0, CloseProvider_proc, &data, 0, &tid); + WaitForSingleObject(hthread, INFINITE); + CloseHandle(hthread); + ok(data.hr == E_HANDLE || data.hr == E_INVALIDARG /* XP */ || broken(data.hr == S_OK) /* Win8 */, "got %#x\n", data.hr); + + if (data.hr != S_OK) + { + hr = PTCloseProvider(hprov); + ok(hr == S_OK, "got %#x\n", hr); + } + + hr = PTOpenProvider(default_name, 0, &hprov); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + for (i = 2; i < 20; i++) + { + hr = PTOpenProvider(default_name, i, &hprov); + ok(hr == 0x80040001 || hr == E_INVALIDARG /* Wine */, "%u: got %#x\n", i, hr); + } +} + +static void test_PTOpenProviderEx(void) +{ + DWORD tid, ver, i; + HPTPROVIDER hprov; + HRESULT hr; + HANDLE hthread; + struct hprov_data data; + + hr = PTOpenProviderEx(default_name, 1, 1, &hprov, NULL); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, 1, 1, &hprov, &ver); + ok(hr == S_OK, "got %#x\n", hr); + ok(ver == 1, "got %#x\n", ver); + + data.hprov = hprov; + hthread = CreateThread(NULL, 0, CloseProvider_proc, &data, 0, &tid); + WaitForSingleObject(hthread, INFINITE); + CloseHandle(hthread); + ok(data.hr == E_HANDLE || data.hr == E_INVALIDARG /* XP */ || broken(data.hr == S_OK) /* Win8 */, "got %#x\n", data.hr); + + if (data.hr != S_OK) + { + hr = PTCloseProvider(hprov); + ok(hr == S_OK, "got %#x\n", hr); + } + + for (i = 1; i < 20; i++) + { + hr = PTOpenProviderEx(default_name, 0, i, &hprov, &ver); + ok(hr == E_INVALIDARG, "%u: got %#x\n", i, hr); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, 1, i, &hprov, &ver); + ok(hr == S_OK, "%u: got %#x\n", i, hr); + ok(ver == 1, "%u: got %#x\n", i, ver); + PTCloseProvider(hprov); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, i, i, &hprov, &ver); + ok(hr == S_OK, "%u: got %#x\n", i, hr); + ok(ver == 1, "%u: got %#x\n", i, ver); + PTCloseProvider(hprov); + } +} + +START_TEST(prntvpt) +{ + DWORD size; + + CoInitializeEx(NULL, COINIT_MULTITHREADED); + + size = ARRAY_SIZE(default_name); + if (!GetDefaultPrinterW(default_name, &size)) + { + skip("no default printer set\n"); + return; + } + + trace("default printer: %s\n", wine_dbgstr_w(default_name)); + + test_PTOpenProvider(); + test_PTOpenProviderEx(); + + CoUninitialize(); +} diff --git a/wrappers/new-dlls/prntvpt/ticket.c b/wrappers/new-dlls/prntvpt/ticket.c new file mode 100644 index 00000000000..13aaf80423f --- /dev/null +++ b/wrappers/new-dlls/prntvpt/ticket.c @@ -0,0 +1,1538 @@ +/* + * Copyright 2019 Dmitry Timoshkov + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS +#define NONAMELESSSTRUCT +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winspool.h" +#include "objbase.h" +#include "prntvpt.h" +#include "initguid.h" +#include "msxml2.h" +#include "wine/heap.h" +#include "wine/debug.h" + +#include "prntvpt_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(prntvpt); + +struct size +{ + int width; + int height; +}; + +struct media +{ + int paper; + struct size size; +}; + +struct resolution +{ + int x; + int y; +}; + +struct page +{ + struct media media; + struct resolution resolution; + int orientation; + int scaling; + int color; +}; + +struct document +{ + int collate; +}; + +struct job +{ + int nup; + int copies; + int input_bin; +}; + +struct ticket +{ + struct job job; + struct document document; + struct page page; +}; + +static const struct +{ + const WCHAR *name; + int paper; +} psk_media[] = +{ + { L"psk:ISOA4", DMPAPER_A4 }, +}; + +static int media_to_paper(const WCHAR *name) +{ + int i; + + for (i = 0 ; i < ARRAY_SIZE(psk_media); i++) + if (!wcscmp(name, psk_media[i].name)) + return psk_media[i].paper; + + FIXME("%s\n", wine_dbgstr_w(name)); + return DMPAPER_A4; +} + +static const WCHAR *paper_to_media(int paper) +{ + int i; + + for (i = 0 ; i < ARRAY_SIZE(psk_media); i++) + if (psk_media[i].paper == paper) + return psk_media[i].name; + + FIXME("%d\n", paper); + return psk_media[0].name; +} + +static BOOL is_valid_node_name(const WCHAR *name) +{ + static const WCHAR * const psf_names[] = { L"psf:ParameterInit", L"psf:Feature" }; + int i; + + for (i = 0 ; i < ARRAY_SIZE(psf_names); i++) + if (!wcscmp(name, psf_names[i])) return TRUE; + + return FALSE; +} + +static HRESULT verify_ticket(IXMLDOMDocument2 *doc) +{ + IXMLDOMElement *element; + IXMLDOMNode *node = NULL; + BSTR str; + HRESULT hr; + + hr = IXMLDOMDocument2_get_documentElement(doc, &element); + if (hr != S_OK) return E_PRINTTICKET_FORMAT; + + hr = IXMLDOMElement_get_tagName(element, &str); + if (hr != S_OK) goto fail; + if (wcscmp(str, L"psf:PrintTicket") != 0) + hr = E_FAIL; + SysFreeString(str); + if (hr != S_OK) goto fail; + + hr = IXMLDOMElement_get_firstChild(element, &node); + IXMLDOMElement_Release(element); + if (hr != S_OK) return S_OK; + + for (;;) + { + VARIANT var; + IXMLDOMNode *next_node; + + hr = IXMLDOMNode_get_nodeName(node, &str); + if (hr != S_OK) break; + if (!is_valid_node_name(str)) + hr = E_FAIL; + SysFreeString(str); + if (hr != S_OK) break; + + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void **)&element); + if (hr != S_OK) break; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + IXMLDOMElement_Release(element); + if (hr != S_OK) break; + if (V_VT(&var) != VT_BSTR) + hr = E_FAIL; + VariantClear(&var); + if (hr != S_OK) break; + + hr = IXMLDOMNode_get_nextSibling(node, &next_node); + if (hr != S_OK) + { + hr = S_OK; + break; + } + + IXMLDOMNode_Release(node); + node = next_node; + } + +fail: + if (node) IXMLDOMNode_Release(node); + + return hr != S_OK ? E_PRINTTICKET_FORMAT : S_OK; +} + +static HRESULT read_int_value(IXMLDOMNode *node, int *value) +{ + IXMLDOMNode *val; + HRESULT hr; + VARIANT var1, var2; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Value[@xsi:type='xsd:integer']", &val); + if (hr != S_OK) return hr; + + VariantInit(&var1); + hr = IXMLDOMNode_get_nodeTypedValue(val, &var1); + if (hr == S_OK) + { + VariantInit(&var2); + hr = VariantChangeTypeEx(&var2, &var1, 0, 0, VT_I4); + if (hr == S_OK) + *value = V_I4(&var2); + + VariantClear(&var1); + } + + IXMLDOMNode_Release(val); + return hr; +} + +static void read_PageMediaSize(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option, *child; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:PageMediaSize']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + ticket->page.media.paper = media_to_paper(V_BSTR(&var)); + TRACE("paper: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->page.media.paper); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + + hr = IXMLDOMNode_selectSingleNode(option, (BSTR)L"./psf:ScoredProperty[@name='psk:MediaSizeWidth']", &child); + if (hr == S_OK) + { + if (read_int_value(child, &ticket->page.media.size.width) == S_OK) + TRACE("width: %d\n", ticket->page.media.size.width); + IXMLDOMNode_Release(child); + } + + hr = IXMLDOMNode_selectSingleNode(option, (BSTR)L"./psf:ScoredProperty[@name='psk:MediaSizeHeight']", &child); + if (hr == S_OK) + { + if (read_int_value(child, &ticket->page.media.size.height) == S_OK) + TRACE("height: %d\n", ticket->page.media.size.height); + IXMLDOMNode_Release(child); + } + + IXMLDOMNode_Release(option); + } + + IXMLDOMNode_Release(node); +} + +static void read_PageOutputColor(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:PageOutputColor']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:Color")) + ticket->page.color = DMCOLOR_COLOR; + else if (!wcscmp(V_BSTR(&var), L"psk:Monochrome")) + ticket->page.color = DMCOLOR_MONOCHROME; + else + { + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + ticket->page.color = DMCOLOR_MONOCHROME; + } + TRACE("color: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->page.color); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); +} + +static void read_PageScaling(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + int scaling = 0; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:PageScaling']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:None")) + scaling = 100; + else if (!wcscmp(V_BSTR(&var), L"psk:CustomSquare")) + scaling = 0; /* psk:PageScalingScale */ + else + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); + + if (!scaling) + { + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:ParameterInit[@name='psk:PageScalingScale']", &node); + if (hr == S_OK) + { + read_int_value(node, &scaling); + IXMLDOMNode_Release(node); + } + } + + if (scaling) + ticket->page.scaling = scaling; + else + ticket->page.scaling = 100; + + TRACE("page.scaling: %d\n", ticket->page.scaling); +} + +static void read_PageResolution(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option, *child; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:PageResolution']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + hr = IXMLDOMNode_selectSingleNode(option, (BSTR)L"./psf:ScoredProperty[@name='psk:ResolutionX']", &child); + if (hr == S_OK) + { + if (read_int_value(child, &ticket->page.resolution.x) == S_OK) + TRACE("resolution.x: %d\n", ticket->page.resolution.x); + IXMLDOMNode_Release(child); + } + + hr = IXMLDOMNode_selectSingleNode(option, (BSTR)L"./psf:ScoredProperty[@name='psk:ResolutionY']", &child); + if (hr == S_OK) + { + if (read_int_value(child, &ticket->page.resolution.y) == S_OK) + TRACE("resolution.y: %d\n", ticket->page.resolution.y); + IXMLDOMNode_Release(child); + } + + IXMLDOMNode_Release(option); + } + + IXMLDOMNode_Release(node); +} + +static void read_PageOrientation(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:PageOrientation']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:Portrait")) + ticket->page.orientation = DMORIENT_PORTRAIT; + else if (!wcscmp(V_BSTR(&var), L"psk:Landscape")) + ticket->page.orientation = DMORIENT_LANDSCAPE; + else + { + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + ticket->page.orientation = DMORIENT_PORTRAIT; + } + TRACE("orientation: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->page.orientation); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); +} + +static void read_DocumentCollate(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:DocumentCollate']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:Collated")) + ticket->document.collate = DMCOLLATE_TRUE; + else if (!wcscmp(V_BSTR(&var), L"psk:Uncollated")) + ticket->document.collate = DMCOLLATE_FALSE; + else + { + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + ticket->document.collate = DMCOLLATE_FALSE; + } + TRACE("document.collate: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->document.collate); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); +} + +static void read_JobInputBin(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:JobInputBin']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:AutoSelect")) + ticket->job.input_bin = DMBIN_AUTO; + else + { + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + ticket->job.input_bin = DMBIN_AUTO; + } + TRACE("input_bin: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->job.input_bin); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); +} + +static void read_JobCopies(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:ParameterInit[@name='psk:JobCopiesAllDocuments']", &node); + if (hr != S_OK) return; + + if (read_int_value(node, &ticket->job.copies) == S_OK) + TRACE("job.copies: %d\n", ticket->job.copies); + + IXMLDOMNode_Release(node); +} + +static void set_SelectionNamespaces(IXMLDOMDocument2 *doc) +{ + IStream *stream; + IXMLDOMElement *element = NULL; + IXMLDOMNamedNodeMap *map = NULL; + HRESULT hr; + LONG count, i; + HGLOBAL hmem; + BSTR str; + VARIANT var; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + if (hr != S_OK) return; + + hr = IXMLDOMDocument2_get_documentElement(doc, &element); + if (hr != S_OK) goto fail; + + hr = IXMLDOMElement_get_attributes(element, &map); + if (hr != S_OK) goto fail; + + hr = IXMLDOMNamedNodeMap_get_length(map, &count); + if (hr != S_OK) goto fail; + + for (i = 0; i < count; i++) + { + IXMLDOMNode *node; + + hr = IXMLDOMNamedNodeMap_get_item(map, i, &node); + if (hr == S_OK) + { + hr = IXMLDOMNode_get_nodeName(node, &str); + if (hr == S_OK) + { + VariantInit(&var); + hr = IXMLDOMNode_get_nodeValue(node, &var); + if (hr == S_OK) + { + if (!wcscmp(str, L"xmlns") || !wcsncmp(str, L"xmlns:", 6)) + { + TRACE("ns[%d]: %s=%s\n", i, wine_dbgstr_w(str), wine_dbgstr_w(V_BSTR(&var))); + IStream_Write(stream, str, wcslen(str) * sizeof(WCHAR), NULL); + IStream_Write(stream, L"=\"", 2 * sizeof(WCHAR), NULL); + IStream_Write(stream, V_BSTR(&var), wcslen(V_BSTR(&var)) * sizeof(WCHAR), NULL); + IStream_Write(stream, L"\" ", 2 * sizeof(WCHAR), NULL); + } + VariantClear(&var); + } + SysFreeString(str); + } + IXMLDOMNode_Release(node); + } + } + + IStream_Write(stream, L"", sizeof(WCHAR), NULL); + + hr = GetHGlobalFromStream(stream, &hmem); + if (hr != S_OK) goto fail; + + str = GlobalLock(hmem); + V_VT(&var) = VT_BSTR; + V_BSTR(&var) = SysAllocString(str); + IXMLDOMDocument2_setProperty(doc, (BSTR)L"SelectionNamespaces", var); + SysFreeString(V_BSTR(&var)); + GlobalUnlock(hmem); + +fail: + if (map) IXMLDOMNamedNodeMap_Release(map); + if (element) IXMLDOMElement_Release(element); + IStream_Release(stream); +} + +static HRESULT parse_ticket(IStream *stream, EPrintTicketScope scope, struct ticket *ticket) +{ + IXMLDOMDocument2 *doc; + VARIANT src; + VARIANT_BOOL ret; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DOMDocument30, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLDOMDocument2, (void **)&doc); + if (hr != S_OK) return hr; + + V_VT(&src) = VT_UNKNOWN; + V_UNKNOWN(&src) = (IUnknown *)stream; + hr = IXMLDOMDocument2_load(doc, src, &ret); + if (hr != S_OK) goto fail; + + hr = verify_ticket(doc); + if (hr != S_OK) goto fail; + + set_SelectionNamespaces(doc); + + /* PageScope is always added */ + read_PageMediaSize(doc, ticket); + read_PageOutputColor(doc, ticket); + read_PageScaling(doc, ticket); + read_PageResolution(doc, ticket); + read_PageOrientation(doc, ticket); + + if (scope > kPTPageScope) + read_DocumentCollate(doc, ticket); + + if (scope > kPTDocumentScope) + { + read_JobInputBin(doc, ticket); + read_JobCopies(doc, ticket); + } + +fail: + IXMLDOMDocument2_Release(doc); + return hr; +} + +static void ticket_to_devmode(const struct ticket *ticket, DEVMODEW *dm) +{ + memset(dm, 0, sizeof(*dm)); + + dm->dmSize = sizeof(*dm); + dm->dmFields = DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH | DM_PAPERWIDTH | DM_SCALE | + DM_COPIES | DM_COLOR | DM_PRINTQUALITY | DM_YRESOLUTION | DM_COLLATE; + dm->u1.s1.dmOrientation = ticket->page.orientation; + dm->u1.s1.dmPaperSize = ticket->page.media.paper; + dm->u1.s1.dmPaperWidth = ticket->page.media.size.width / 100; + dm->u1.s1.dmPaperLength = ticket->page.media.size.height / 100; + dm->u1.s1.dmScale = ticket->page.scaling; + dm->u1.s1.dmCopies = ticket->job.copies; + dm->dmColor = ticket->page.color; + dm->u1.s1.dmPrintQuality = ticket->page.resolution.x; + dm->dmYResolution = ticket->page.resolution.y; + dm->dmCollate = ticket->document.collate; +} + +static void devmode_to_ticket(const DEVMODEW *dm, struct ticket *ticket) +{ + if (dm->dmFields & DM_ORIENTATION) + ticket->page.orientation = dm->u1.s1.dmOrientation; + if (dm->dmFields & DM_PAPERSIZE) + ticket->page.media.paper = dm->u1.s1.dmPaperSize; + if (dm->dmFields & DM_PAPERLENGTH) + ticket->page.media.size.width = dm->u1.s1.dmPaperWidth * 100; + if (dm->dmFields & DM_PAPERWIDTH) + ticket->page.media.size.height = dm->u1.s1.dmPaperLength * 100; + if (dm->dmFields & DM_SCALE) + ticket->page.scaling = dm->u1.s1.dmScale; + if (dm->dmFields & DM_COPIES) + ticket->job.copies = dm->u1.s1.dmCopies; + if (dm->dmFields & DM_COLOR) + ticket->page.color = dm->dmColor; + if (dm->dmFields & DM_PRINTQUALITY) + { + ticket->page.resolution.x = dm->u1.s1.dmPrintQuality; + ticket->page.resolution.y = dm->u1.s1.dmPrintQuality; + } + if (dm->dmFields & DM_YRESOLUTION) + ticket->page.resolution.y = dm->dmYResolution; + if (dm->dmFields & DM_LOGPIXELS) + { + ticket->page.resolution.x = dm->dmLogPixels; + ticket->page.resolution.y = dm->dmLogPixels; + } + if (dm->dmFields & DM_COLLATE) + ticket->document.collate = dm->dmCollate; +} + +static HRESULT initialize_ticket(struct prn_provider *prov, struct ticket *ticket) +{ + PRINTER_INFO_2W *pi2; + DWORD size; + HRESULT hr = S_OK; + + GetPrinterW(prov->hprn, 2, NULL, 0, &size); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return HRESULT_FROM_WIN32(GetLastError()); + + pi2 = heap_alloc(size); + if (!pi2) return E_OUTOFMEMORY; + + if (!GetPrinterW(prov->hprn, 2, (LPBYTE)pi2, size, NULL)) + hr = HRESULT_FROM_WIN32(GetLastError()); + else + devmode_to_ticket(pi2->pDevMode, ticket); + + heap_free(pi2); + return hr; +} + +HRESULT WINAPI PTConvertPrintTicketToDevMode(HPTPROVIDER provider, IStream *stream, EDefaultDevmodeType type, + EPrintTicketScope scope, ULONG *size, PDEVMODEW *dm, BSTR *error) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + HRESULT hr; + struct ticket ticket; + + TRACE("%p,%p,%d,%d,%p,%p,%p\n", provider, stream, type, scope, size, dm, error); + + if (!is_valid_provider(provider) || !stream || !size || !dm) + return E_INVALIDARG; + + hr = initialize_ticket(prov, &ticket); + if (hr != S_OK) return hr; + + hr = parse_ticket(stream, scope, &ticket); + if (hr != S_OK) return hr; + + *dm = heap_alloc(sizeof(**dm)); + if (!*dm) return E_OUTOFMEMORY; + + ticket_to_devmode(&ticket, *dm); + *size = sizeof(**dm); + + return S_OK; +} + +static HRESULT add_attribute(IXMLDOMElement *element, const WCHAR *attr, const WCHAR *value) +{ + VARIANT var; + BSTR name; + HRESULT hr; + + name = SysAllocString(attr); + V_VT(&var) = VT_BSTR; + V_BSTR(&var) = SysAllocString(value); + + hr = IXMLDOMElement_setAttribute(element, name, var); + + SysFreeString(name); + SysFreeString(V_BSTR(&var)); + + return hr; +} + +static HRESULT create_element(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + IXMLDOMDocument *doc; + HRESULT hr; + + hr = IXMLDOMElement_get_ownerDocument(root, &doc); + if (hr != S_OK) return hr; + + hr = IXMLDOMDocument_createElement(doc, (BSTR)name, child); + if (hr == S_OK) + hr = IXMLDOMElement_appendChild(root, (IXMLDOMNode *)*child, NULL); + + IXMLDOMDocument_Release(doc); + return hr; +} + +static HRESULT write_int_value(IXMLDOMElement *root, int value) +{ + HRESULT hr; + IXMLDOMElement *child; + VARIANT var; + + hr = create_element(root, L"psf:Value", &child); + if (hr != S_OK) return hr; + + hr = add_attribute(child, L"xsi:type", L"xsd:integer"); + if (hr != S_OK) return hr; + + V_VT(&var) = VT_I4; + V_I4(&var) = value; + hr = IXMLDOMElement_put_nodeTypedValue(child, var); + + IXMLDOMElement_Release(child); + return hr; +} + +static HRESULT create_Feature(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:Feature", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + +static HRESULT create_Option(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:Option", child); + if (hr != S_OK) return hr; + + if (name) + hr = add_attribute(*child, L"name", name); + + return hr; +} + +static HRESULT create_ParameterInit(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:ParameterInit", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + +static HRESULT create_ParameterRef(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:ParameterRef", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + +static HRESULT create_ParameterDef(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:ParameterDef", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + +static HRESULT create_ScoredProperty(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:ScoredProperty", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + +static HRESULT write_PageMediaSize(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL, *property; + HRESULT hr; + + hr = create_Feature(root, L"psk:PageMediaSize", &feature); + if (hr != S_OK) return hr; + + hr = create_Option(feature, paper_to_media(ticket->page.media.paper), &option); + if (hr != S_OK) goto fail; + + hr = create_ScoredProperty(option, L"psk:MediaSizeWidth", &property); + if (hr != S_OK) goto fail; + hr = write_int_value(property, ticket->page.media.size.width); + IXMLDOMElement_Release(property); + if (hr != S_OK) goto fail; + + hr = create_ScoredProperty(option, L"psk:MediaSizeHeight", &property); + if (hr != S_OK) goto fail; + hr = write_int_value(property, ticket->page.media.size.height); + IXMLDOMElement_Release(property); + +fail: + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageOutputColor(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL; + HRESULT hr; + + hr = create_Feature(root, L"psk:PageOutputColor", &feature); + if (hr != S_OK) return hr; + + if (ticket->page.color == DMCOLOR_COLOR) + hr = create_Option(feature, L"psk:Color", &option); + else /* DMCOLOR_MONOCHROME */ + hr = create_Option(feature, L"psk:Monochrome", &option); + + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageScaling(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL; + HRESULT hr; + + hr = create_Feature(root, L"psk:PageScaling", &feature); + if (hr != S_OK) return hr; + + if (ticket->page.scaling == 100) + { + hr = create_Option(feature, L"psk:None", &option); + if (hr == S_OK) IXMLDOMElement_Release(option); + } + else + { + hr = create_Option(feature, L"psk:CustomSquare", &option); + if (hr == S_OK) + { + IXMLDOMElement *property, *parameter; + + hr = create_ScoredProperty(option, L"psk:Scale", &property); + if (hr == S_OK) + { + hr = create_ParameterRef(property, L"psk:PageScalingScale", ¶meter); + if (hr == S_OK) + { + IXMLDOMElement_Release(parameter); + + hr = create_ParameterInit(root, L"psk:PageScalingScale", ¶meter); + if (hr == S_OK) + { + hr = write_int_value(parameter, ticket->page.scaling); + IXMLDOMElement_Release(parameter); + } + } + + IXMLDOMElement_Release(property); + } + + IXMLDOMElement_Release(option); + } + } + + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageResolution(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL, *property; + HRESULT hr; + + hr = create_Feature(root, L"psk:PageResolution", &feature); + if (hr != S_OK) return hr; + + hr = create_Option(feature, NULL, &option); + if (hr != S_OK) goto fail; + + hr = create_ScoredProperty(option, L"psk:ResolutionX", &property); + if (hr != S_OK) goto fail; + hr = write_int_value(property, ticket->page.resolution.x); + IXMLDOMElement_Release(property); + if (hr != S_OK) goto fail; + + hr = create_ScoredProperty(option, L"psk:ResolutionY", &property); + if (hr != S_OK) goto fail; + hr = write_int_value(property, ticket->page.resolution.y); + IXMLDOMElement_Release(property); + +fail: + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageOrientation(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL; + HRESULT hr; + + hr = create_Feature(root, L"psk:PageOrientation", &feature); + if (hr != S_OK) return hr; + + if (ticket->page.orientation == DMORIENT_PORTRAIT) + hr = create_Option(feature, L"psk:Portrait", &option); + else /* DMORIENT_LANDSCAPE */ + hr = create_Option(feature, L"psk:Landscape", &option); + + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_DocumentCollate(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL; + HRESULT hr; + + hr = create_Feature(root, L"psk:DocumentCollate", &feature); + if (hr != S_OK) return hr; + + if (ticket->document.collate == DMCOLLATE_TRUE) + hr = create_Option(feature, L"psk:Collated", &option); + else /* DMCOLLATE_FALSE */ + hr = create_Option(feature, L"psk:Uncollated", &option); + + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_JobInputBin(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *feature, *option = NULL; + HRESULT hr; + + hr = create_Feature(root, L"psk:JobInputBin", &feature); + if (hr != S_OK) return hr; + + if (ticket->job.input_bin != DMBIN_AUTO) + FIXME("job.input_bin: %d\n", ticket->job.input_bin); + + hr = create_Option(feature, L"psk:AutoSelect", &option); + + if (option) IXMLDOMElement_Release(option); + IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_JobCopies(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *parameter; + HRESULT hr; + + hr = create_ParameterInit(root, L"psk:JobCopiesAllDocuments", ¶meter); + if (hr != S_OK) return hr; + + hr = write_int_value(parameter, ticket->job.copies); + + IXMLDOMElement_Release(parameter); + return hr; +} + +static HRESULT write_attributes(IXMLDOMElement *element) +{ + HRESULT hr; + + hr = add_attribute(element, L"xmlns:psf", L"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework"); + if (hr != S_OK) return hr; + hr = add_attribute(element, L"xmlns:psk", L"http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"); + if (hr != S_OK) return hr; + hr = add_attribute(element, L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance"); + if (hr != S_OK) return hr; + hr = add_attribute(element, L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema"); + if (hr != S_OK) return hr; + + return add_attribute(element, L"version", L"1"); +} + +static HRESULT write_ticket(IStream *stream, const struct ticket *ticket, EPrintTicketScope scope) +{ + static const char xmldecl[] = "\r\n"; + HRESULT hr; + IXMLDOMDocument *doc; + IXMLDOMElement *root = NULL; + VARIANT var; + + hr = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLDOMDocument, (void **)&doc); + if (hr != S_OK) return hr; + + hr = IXMLDOMDocument_createElement(doc, (BSTR)L"psf:PrintTicket", &root); + if (hr != S_OK) goto fail; + + hr = IXMLDOMDocument_appendChild(doc, (IXMLDOMNode *)root, NULL); + if (hr != S_OK) goto fail; + + hr = write_attributes(root); + if (hr != S_OK) goto fail; + + hr = write_PageMediaSize(root, ticket); + if (hr != S_OK) goto fail; + hr = write_PageOutputColor(root, ticket); + if (hr != S_OK) goto fail; + hr = write_PageScaling(root, ticket); + if (hr != S_OK) goto fail; + hr = write_PageResolution(root, ticket); + if (hr != S_OK) goto fail; + hr = write_PageOrientation(root, ticket); + if (hr != S_OK) goto fail; + + if (scope >= kPTDocumentScope) + { + hr = write_DocumentCollate(root, ticket); + if (hr != S_OK) goto fail; + } + + if (scope >= kPTJobScope) + { + hr = write_JobInputBin(root, ticket); + if (hr != S_OK) goto fail; + hr = write_JobCopies(root, ticket); + if (hr != S_OK) goto fail; + } + + hr = IStream_Write(stream, xmldecl, strlen(xmldecl), NULL); + if (hr != S_OK) goto fail; + + V_VT(&var) = VT_UNKNOWN; + V_UNKNOWN(&var) = (IUnknown *)stream; + hr = IXMLDOMDocument_save(doc, var); + +fail: + if (root) IXMLDOMElement_Release(root); + IXMLDOMDocument_Release(doc); + return hr; +} + +static void dump_fields(DWORD fields) +{ + int add_space = 0; + +#define CHECK_FIELD(flag) \ +do \ +{ \ + if (fields & flag) \ + { \ + if (add_space++) TRACE(" "); \ + TRACE(#flag); \ + fields &= ~flag; \ + } \ +} \ +while (0) + + CHECK_FIELD(DM_ORIENTATION); + CHECK_FIELD(DM_PAPERSIZE); + CHECK_FIELD(DM_PAPERLENGTH); + CHECK_FIELD(DM_PAPERWIDTH); + CHECK_FIELD(DM_SCALE); + CHECK_FIELD(DM_POSITION); + CHECK_FIELD(DM_NUP); + CHECK_FIELD(DM_DISPLAYORIENTATION); + CHECK_FIELD(DM_COPIES); + CHECK_FIELD(DM_DEFAULTSOURCE); + CHECK_FIELD(DM_PRINTQUALITY); + CHECK_FIELD(DM_COLOR); + CHECK_FIELD(DM_DUPLEX); + CHECK_FIELD(DM_YRESOLUTION); + CHECK_FIELD(DM_TTOPTION); + CHECK_FIELD(DM_COLLATE); + CHECK_FIELD(DM_FORMNAME); + CHECK_FIELD(DM_LOGPIXELS); + CHECK_FIELD(DM_BITSPERPEL); + CHECK_FIELD(DM_PELSWIDTH); + CHECK_FIELD(DM_PELSHEIGHT); + CHECK_FIELD(DM_DISPLAYFLAGS); + CHECK_FIELD(DM_DISPLAYFREQUENCY); + CHECK_FIELD(DM_ICMMETHOD); + CHECK_FIELD(DM_ICMINTENT); + CHECK_FIELD(DM_MEDIATYPE); + CHECK_FIELD(DM_DITHERTYPE); + CHECK_FIELD(DM_PANNINGWIDTH); + CHECK_FIELD(DM_PANNINGHEIGHT); + if (fields) TRACE(" %#x", fields); + TRACE("\n"); +#undef CHECK_FIELD +} + +/* Dump DEVMODE structure without a device specific part. + * Some applications and drivers fail to specify correct field + * flags (like DM_FORMNAME), so dump everything. + */ +static void dump_devmode(const DEVMODEW *dm) +{ + if (!TRACE_ON(prntvpt)) return; + + TRACE("dmDeviceName: %s\n", debugstr_w(dm->dmDeviceName)); + TRACE("dmSpecVersion: 0x%04x\n", dm->dmSpecVersion); + TRACE("dmDriverVersion: 0x%04x\n", dm->dmDriverVersion); + TRACE("dmSize: 0x%04x\n", dm->dmSize); + TRACE("dmDriverExtra: 0x%04x\n", dm->dmDriverExtra); + TRACE("dmFields: 0x%04x\n", dm->dmFields); + dump_fields(dm->dmFields); + TRACE("dmOrientation: %d\n", dm->u1.s1.dmOrientation); + TRACE("dmPaperSize: %d\n", dm->u1.s1.dmPaperSize); + TRACE("dmPaperLength: %d\n", dm->u1.s1.dmPaperLength); + TRACE("dmPaperWidth: %d\n", dm->u1.s1.dmPaperWidth); + TRACE("dmScale: %d\n", dm->u1.s1.dmScale); + TRACE("dmCopies: %d\n", dm->u1.s1.dmCopies); + TRACE("dmDefaultSource: %d\n", dm->u1.s1.dmDefaultSource); + TRACE("dmPrintQuality: %d\n", dm->u1.s1.dmPrintQuality); + TRACE("dmColor: %d\n", dm->dmColor); + TRACE("dmDuplex: %d\n", dm->dmDuplex); + TRACE("dmYResolution: %d\n", dm->dmYResolution); + TRACE("dmTTOption: %d\n", dm->dmTTOption); + TRACE("dmCollate: %d\n", dm->dmCollate); + TRACE("dmFormName: %s\n", debugstr_w(dm->dmFormName)); + TRACE("dmLogPixels %u\n", dm->dmLogPixels); + TRACE("dmBitsPerPel %u\n", dm->dmBitsPerPel); + TRACE("dmPelsWidth %u\n", dm->dmPelsWidth); + TRACE("dmPelsHeight %u\n", dm->dmPelsHeight); +} + +HRESULT WINAPI PTConvertDevModeToPrintTicket(HPTPROVIDER provider, ULONG size, PDEVMODEW dm, + EPrintTicketScope scope, IStream *stream) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + struct ticket ticket; + HRESULT hr; + + TRACE("%p,%u,%p,%d,%p\n", provider, size, dm, scope, stream); + + if (!is_valid_provider(provider) || !dm || !stream) + return E_INVALIDARG; + + dump_devmode(dm); + + if (!IsValidDevmodeW(dm, size)) + return E_INVALIDARG; + + hr = initialize_ticket(prov, &ticket); + if (hr != S_OK) return hr; + devmode_to_ticket(dm, &ticket); + + return write_ticket(stream, &ticket, scope); +} + +HRESULT WINAPI PTMergeAndValidatePrintTicket(HPTPROVIDER provider, IStream *base, IStream *delta, + EPrintTicketScope scope, IStream *result, BSTR *error) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + struct ticket ticket; + HRESULT hr; + + TRACE("%p,%p,%p,%d,%p,%p\n", provider, base, delta, scope, result, error); + + if (!is_valid_provider(provider) || !base || !result) + return E_INVALIDARG; + + hr = initialize_ticket(prov, &ticket); + if (hr != S_OK) return hr; + + hr = parse_ticket(base, scope, &ticket); + if (hr != S_OK) return hr; + + if (delta) + { + hr = parse_ticket(delta, scope, &ticket); + if (hr != S_OK) return hr; + } + + hr = write_ticket(result, &ticket, scope); + return hr ? hr : S_PT_NO_CONFLICT; +} + +static HRESULT write_PageMediaSize_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int count, i; + POINT *pt; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + count = DeviceCapabilitiesW(device, NULL, DC_PAPERSIZE, NULL, NULL); + if (count <= 0) + return HRESULT_FROM_WIN32(GetLastError()); + + pt = heap_alloc(count * sizeof(*pt)); + if (!pt) return E_OUTOFMEMORY; + + count = DeviceCapabilitiesW(device, NULL, DC_PAPERSIZE, (LPWSTR)pt, NULL); + if (count <= 0) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto fail; + } + + hr = create_Feature(root, L"psk:PageMediaSize", &feature); + if (hr != S_OK) goto fail; + + for (i = 0; i < count; i++) + { + } + +fail: + if (feature) IXMLDOMElement_Release(feature); + heap_free(pt); + return hr; +} + +static HRESULT write_PageOutputColor_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int color; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + color = DeviceCapabilitiesW(device, NULL, DC_COLORDEVICE, NULL, NULL); + TRACE("DC_COLORDEVICE: %d\n", color); + + hr = create_Feature(root, L"psk:PageOutputColor", &feature); + if (hr != S_OK) goto fail; + +fail: + if (feature) IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageScaling_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + hr = create_Feature(root, L"psk:PageScaling", &feature); + if (hr != S_OK) goto fail; + +fail: + if (feature) IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_PageResolution_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int count, i; + struct + { + LONG x; + LONG y; + } *res; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + count = DeviceCapabilitiesW(device, NULL, DC_ENUMRESOLUTIONS, NULL, NULL); + if (count <= 0) + return HRESULT_FROM_WIN32(GetLastError()); + + res = heap_alloc(count * sizeof(*res)); + if (!res) return E_OUTOFMEMORY; + + count = DeviceCapabilitiesW(device, NULL, DC_ENUMRESOLUTIONS, (LPWSTR)res, NULL); + if (count <= 0) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto fail; + } + + hr = create_Feature(root, L"psk:PageResolution", &feature); + if (hr != S_OK) goto fail; + + for (i = 0; i < count; i++) + { + } + +fail: + if (feature) IXMLDOMElement_Release(feature); + heap_free(res); + return hr; +} + +static HRESULT write_PageOrientation_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int landscape; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + landscape = DeviceCapabilitiesW(device, NULL, DC_ORIENTATION, NULL, NULL); + TRACE("DC_ORIENTATION: %d\n", landscape); + + hr = create_Feature(root, L"psk:PageOrientation", &feature); + if (hr != S_OK) goto fail; + +fail: + if (feature) IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_DocumentCollate_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int collate; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + collate = DeviceCapabilitiesW(device, NULL, DC_COLLATE, NULL, NULL); + TRACE("DC_COLLATE: %d\n", collate); + + hr = create_Feature(root, L"psk:DocumentCollate", &feature); + if (hr != S_OK) goto fail; + +fail: + if (feature) IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_JobInputBin_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int count, i; + WORD *bin; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + count = DeviceCapabilitiesW(device, NULL, DC_BINS, NULL, NULL); + if (count <= 0) + return HRESULT_FROM_WIN32(GetLastError()); + + bin = heap_alloc(count * sizeof(*bin)); + if (!bin) return E_OUTOFMEMORY; + + count = DeviceCapabilitiesW(device, NULL, DC_BINS, (LPWSTR)bin, NULL); + if (count <= 0) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto fail; + } + + hr = create_Feature(root, L"psk:JobInputBin", &feature); + if (hr != S_OK) goto fail; + + for (i = 0; i < count; i++) + { + } + +fail: + if (feature) IXMLDOMElement_Release(feature); + heap_free(bin); + return hr; +} + +static HRESULT write_JobCopies_caps(const WCHAR *device, IXMLDOMElement *root) +{ + HRESULT hr = S_OK; + int copies; + IXMLDOMElement *feature = NULL; + + FIXME("stub\n"); + + copies = DeviceCapabilitiesW(device, NULL, DC_COPIES, NULL, NULL); + TRACE("DC_COPIES: %d\n", copies); + + hr = create_ParameterDef(root, L"psk:JobCopiesAllDocuments", &feature); + if (hr != S_OK) goto fail; + +fail: + if (feature) IXMLDOMElement_Release(feature); + return hr; +} + +static HRESULT write_print_capabilities(const WCHAR *device, IStream *stream) +{ + static const char xmldecl[] = "\r\n"; + HRESULT hr; + IXMLDOMDocument *doc; + IXMLDOMElement *root = NULL; + VARIANT var; + + hr = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLDOMDocument, (void **)&doc); + if (hr != S_OK) return hr; + + hr = IXMLDOMDocument_createElement(doc, (BSTR)L"psf:PrintCapabilities", &root); + if (hr != S_OK) goto fail; + + hr = IXMLDOMDocument_appendChild(doc, (IXMLDOMNode *)root, NULL); + if (hr != S_OK) goto fail; + + hr = write_attributes(root); + if (hr != S_OK) goto fail; + + hr = write_PageMediaSize_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_PageOutputColor_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_PageScaling_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_PageResolution_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_PageOrientation_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_DocumentCollate_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_JobInputBin_caps(device, root); + if (hr != S_OK) goto fail; + hr = write_JobCopies_caps(device, root); + if (hr != S_OK) goto fail; + + hr = IStream_Write(stream, xmldecl, strlen(xmldecl), NULL); + if (hr != S_OK) goto fail; + + V_VT(&var) = VT_UNKNOWN; + V_UNKNOWN(&var) = (IUnknown *)stream; + hr = IXMLDOMDocument_save(doc, var); + +fail: + if (root) IXMLDOMElement_Release(root); + IXMLDOMDocument_Release(doc); + return hr; +} + +HRESULT WINAPI PTGetPrintCapabilities(HPTPROVIDER provider, IStream *stream, IStream *caps, BSTR *error) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + struct ticket ticket; + HRESULT hr; + + TRACE("%p,%p,%p,%p\n", provider, stream, caps, error); + + if (!is_valid_provider(provider) || !stream || !caps) + return E_INVALIDARG; + + hr = parse_ticket(stream, kPTJobScope, &ticket); + if (hr != S_OK) return hr; + + return write_print_capabilities(prov->name, caps); +} diff --git a/wrappers/new-dlls/sechost/Makefile.in b/wrappers/new-dlls/sechost/Makefile.in new file mode 100644 index 00000000000..f4d88272857 --- /dev/null +++ b/wrappers/new-dlls/sechost/Makefile.in @@ -0,0 +1,15 @@ +MODULE = sechost.dll +IMPORTLIB = sechost +IMPORTS = kernelbase +DELAYIMPORTS = rpcrt4 + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + security.c \ + service.c \ + trace.c + +IDL_SRCS = \ + plugplay.idl \ + svcctl.idl diff --git a/wrappers/new-dlls/sechost/plugplay.idl b/wrappers/new-dlls/sechost/plugplay.idl new file mode 100644 index 00000000000..05e040388e4 --- /dev/null +++ b/wrappers/new-dlls/sechost/plugplay.idl @@ -0,0 +1,2 @@ +#pragma makedep client +#include "wine/plugplay.idl" diff --git a/wrappers/new-dlls/sechost/sechost.spec b/wrappers/new-dlls/sechost/sechost.spec new file mode 100644 index 00000000000..0867412c1cb --- /dev/null +++ b/wrappers/new-dlls/sechost/sechost.spec @@ -0,0 +1,208 @@ +@ stub I_ScSetServiceBitsA +@ stub I_ScSetServiceBitsW +@ stub AuditComputeEffectivePolicyBySid +@ stub AuditEnumerateCategories +@ stub AuditEnumeratePerUserPolicy +@ stub AuditEnumerateSubCategories +@ stub AuditFree +@ stub AuditLookupCategoryNameW +@ stub AuditLookupSubCategoryNameW +@ stub AuditQueryGlobalSaclW +@ stub AuditQueryPerUserPolicy +@ stub AuditQuerySecurity +@ stdcall AuditQuerySystemPolicy(ptr long ptr) advapi32.AuditQuerySystemPolicy +@ stub AuditSetGlobalSaclW +@ stub AuditSetPerUserPolicy +@ stub AuditSetSecurity +@ stub AuditSetSystemPolicy +@ stub BuildSecurityDescriptorForSharingAccess +@ stub BuildSecurityDescriptorForSharingAccessEx +@ stub CapabilityCheck +@ stub CapabilityCheckForSingleSessionSku +@ stdcall ChangeServiceConfig2A(long long ptr) +@ stdcall ChangeServiceConfig2W(long long ptr) +@ stdcall ChangeServiceConfigA(long long long long wstr str ptr str str str str) +@ stdcall ChangeServiceConfigW(long long long long wstr wstr ptr wstr wstr wstr wstr) +@ stdcall CloseServiceHandle(long) +@ stdcall CloseTrace(int64) +@ stdcall ControlService(long long ptr) +@ stub ControlServiceExA +@ stub ControlServiceExW +@ stdcall ControlTraceA(int64 str ptr long) +@ stdcall ControlTraceW(int64 wstr ptr long) +@ stub ConvertSDToStringSDRootDomainW +@ stdcall ConvertSecurityDescriptorToStringSecurityDescriptorW(ptr long long ptr ptr) +@ stdcall ConvertSidToStringSidW(ptr ptr) +@ stub ConvertStringSDToSDDomainA +@ stub ConvertStringSDToSDDomainW +@ stub ConvertStringSDToSDRootDomainW +@ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr) +@ stdcall ConvertStringSidToSidW(ptr ptr) +@ stdcall CreateServiceA(long str str long long long long str str ptr str str str) +@ stub CreateServiceEx +@ stdcall CreateServiceW(long wstr wstr long long long long wstr wstr ptr wstr wstr wstr) +@ stub CredBackupCredentials +@ stdcall CredDeleteA(str long long) advapi32.CredDeleteA +@ stdcall CredDeleteW(wstr long long) advapi32.CredDeleteW +@ stub CredEncryptAndMarshalBinaryBlob +@ stdcall CredEnumerateA(str long ptr ptr) advapi32.CredEnumerateA +@ stdcall CredEnumerateW(wstr long ptr ptr) advapi32.CredEnumerateW +@ stub CredFindBestCredentialA +@ stub CredFindBestCredentialW +@ stdcall CredFree(ptr) advapi32.CredFree +@ stdcall CredGetSessionTypes(long ptr) advapi32.CredGetSessionTypes +@ stub CredGetTargetInfoA +@ stub CredGetTargetInfoW +@ stdcall CredIsMarshaledCredentialW(wstr) advapi32.CredIsMarshaledCredentialW +@ stub CredIsProtectedA +@ stub CredIsProtectedW +@ stdcall CredMarshalCredentialA(long ptr ptr) advapi32.CredMarshalCredentialA +@ stdcall CredMarshalCredentialW(long ptr ptr) advapi32.CredMarshalCredentialW +@ stub CredParseUserNameWithType +@ stub CredProfileLoaded +@ stub CredProfileLoadedEx +@ stub CredProfileUnloaded +@ stub CredProtectA +@ stub CredProtectW +@ stdcall CredReadA(str long long ptr) advapi32.CredReadA +@ stub CredReadByTokenHandle +@ stdcall CredReadDomainCredentialsA(ptr long ptr ptr) advapi32.CredReadDomainCredentialsA +@ stdcall CredReadDomainCredentialsW(ptr long ptr ptr) advapi32.CredReadDomainCredentialsW +@ stdcall CredReadW(wstr long long ptr) advapi32.CredReadW +@ stub CredRestoreCredentials +@ stdcall CredUnmarshalCredentialA(str ptr ptr) advapi32.CredUnmarshalCredentialA +@ stdcall CredUnmarshalCredentialW(wstr ptr ptr) advapi32.CredUnmarshalCredentialW +@ stub CredUnprotectA +@ stub CredUnprotectW +@ stdcall CredWriteA(ptr long) advapi32.CredWriteA +@ stub CredWriteDomainCredentialsA +@ stub CredWriteDomainCredentialsW +@ stdcall CredWriteW(ptr long) advapi32.CredWriteW +@ stub CredpConvertCredential +@ stub CredpConvertOneCredentialSize +@ stub CredpConvertTargetInfo +@ stub CredpDecodeCredential +@ stub CredpEncodeCredential +@ stub CredpEncodeSecret +@ stdcall DeleteService(long) +@ stdcall EnableTraceEx2(int64 ptr long long int64 int64 long ptr) +@ stdcall EnumDependentServicesW(long long ptr long ptr ptr) +@ stdcall EnumServicesStatusExW(long long long long ptr long ptr ptr ptr wstr) +@ stub EnumerateIdentityProviders +@ stub EnumerateTraceGuidsEx +@ stub EtwQueryRealtimeConsumer +@ stub EventAccessControl +@ stub EventAccessQuery +@ stub EventAccessRemove +@ stub FreeTransientObjectSecurityDescriptor +@ stub GetDefaultIdentityProvider +@ stub GetIdentityProviderInfoByGUID +@ stub GetIdentityProviderInfoByName +@ stub GetServiceDirectory +@ stdcall GetServiceDisplayNameW(ptr wstr ptr ptr) +@ stdcall GetServiceKeyNameW(long wstr ptr ptr) +@ stub GetServiceRegistryStateKey +@ stub I_QueryTagInformation +@ stub I_RegisterSvchostNotificationCallback +@ stub I_ScBroadcastServiceControlMessage +@ stub I_ScIsSecurityProcess +@ stub I_ScPnPGetServiceName +@ stub I_ScQueryServiceConfig +@ stdcall I_ScRegisterDeviceNotification(ptr ptr long) +@ stub I_ScRegisterPreshutdownRestart +@ stub I_ScReparseServiceDatabase +@ stub I_ScRpcBindA +@ stub I_ScRpcBindW +@ stub I_ScSendPnPMessage +@ stub I_ScSendTSMessage +@ stdcall I_ScUnregisterDeviceNotification(ptr) +@ stub I_ScValidatePnPService +@ stub LocalGetConditionForString +@ stub LocalGetReferencedTokenTypesForCondition +@ stub LocalGetStringForCondition +@ stub LocalRpcBindingCreateWithSecurity +@ stub LocalRpcBindingSetAuthInfoEx +@ stub LookupAccountNameLocalA +@ stub LookupAccountNameLocalW +@ stdcall LookupAccountSidLocalA(ptr ptr ptr ptr ptr ptr) advapi32.LookupAccountSidLocalA +@ stdcall LookupAccountSidLocalW(ptr ptr ptr ptr ptr ptr) advapi32.LookupAccountSidLocalW +@ stdcall LsaAddAccountRights(ptr ptr ptr long) advapi32.LsaAddAccountRights +@ stdcall LsaClose(ptr) advapi32.LsaClose +@ stub LsaCreateSecret +@ stub LsaDelete +@ stdcall LsaEnumerateAccountRights(ptr ptr ptr ptr) advapi32.LsaEnumerateAccountRights +@ stdcall LsaEnumerateAccountsWithUserRight(ptr ptr ptr ptr) advapi32.LsaEnumerateAccountsWithUserRight +@ stdcall LsaFreeMemory(ptr) advapi32.LsaFreeMemory +@ stub LsaICLookupNames +@ stub LsaICLookupNamesWithCreds +@ stub LsaICLookupSids +@ stub LsaICLookupSidsWithCreds +@ stub LsaLookupClose +@ stub LsaLookupFreeMemory +@ stub LsaLookupGetDomainInfo +@ stub LsaLookupManageSidNameMapping +@ stdcall LsaLookupNames2(ptr long long ptr ptr ptr) advapi32.LsaLookupNames2 +@ stub LsaLookupOpenLocalPolicy +@ stdcall LsaLookupSids(ptr long ptr ptr ptr) advapi32.LsaLookupSids +@ stub LsaLookupSids2 +@ stub LsaLookupTranslateNames +@ stub LsaLookupTranslateSids +@ stub LsaLookupUserAccountType +@ stdcall LsaOpenPolicy(long ptr long long) advapi32.LsaOpenPolicy +@ stub LsaOpenSecret +@ stdcall LsaQueryInformationPolicy(ptr long ptr) advapi32.LsaQueryInformationPolicy +@ stub LsaQuerySecret +@ stdcall LsaRemoveAccountRights(ptr ptr long ptr long) advapi32.LsaRemoveAccountRights +@ stdcall LsaRetrievePrivateData(ptr ptr ptr) advapi32.LsaRetrievePrivateData +@ stdcall LsaSetInformationPolicy(long long ptr) advapi32.LsaSetInformationPolicy +@ stdcall LsaSetSecret(ptr ptr ptr) advapi32.LsaSetSecret +@ stdcall LsaStorePrivateData(ptr ptr ptr) advapi32.LsaStorePrivateData +@ stub NotifyServiceStatusChange +@ stub NotifyServiceStatusChangeA +@ stdcall NotifyServiceStatusChangeW(ptr long ptr) +@ stdcall OpenSCManagerA(str str long) +@ stdcall OpenSCManagerW(wstr wstr long) +@ stdcall OpenServiceA(long str long) +@ stdcall OpenServiceW(long wstr long) +@ stdcall -ret64 OpenTraceW(ptr) +@ stdcall ProcessTrace(ptr long ptr ptr) +@ stdcall QueryAllTracesA(ptr long ptr) +@ stdcall QueryAllTracesW(ptr long ptr) +@ stub QueryLocalUserServiceName +@ stdcall QueryServiceConfig2A(long long ptr long ptr) +@ stdcall QueryServiceConfig2W(long long ptr long ptr) +@ stdcall QueryServiceConfigA(long ptr long ptr) +@ stdcall QueryServiceConfigW(long ptr long ptr) +@ stub QueryServiceDynamicInformation +@ stdcall QueryServiceObjectSecurity(long long ptr long ptr) +@ stdcall QueryServiceStatus(long ptr) +@ stdcall QueryServiceStatusEx(long long ptr long ptr) +@ stub QueryTraceProcessingHandle +@ stub QueryTransientObjectSecurityDescriptor +@ stub QueryUserServiceName +@ stub QueryUserServiceNameForContext +@ stdcall RegisterServiceCtrlHandlerA(str ptr) +@ stdcall RegisterServiceCtrlHandlerExA(str ptr ptr) +@ stdcall RegisterServiceCtrlHandlerExW(wstr ptr ptr) +@ stdcall RegisterServiceCtrlHandlerW(wstr ptr) +@ stdcall RegisterTraceGuidsA(ptr ptr ptr long ptr str str ptr) advapi32.RegisterTraceGuidsA +@ stub ReleaseIdentityProviderEnumContext +@ stub RemoveTraceCallback +@ stub RpcClientCapabilityCheck +@ stub SetLocalRpcServerInterfaceSecurity +@ stub SetLocalRpcServerProtseqSecurity +@ stdcall SetServiceObjectSecurity(long long ptr) +@ stdcall SetServiceStatus(long ptr) +@ stub SetTraceCallback +@ stdcall StartServiceA(long long ptr) +@ stdcall StartServiceCtrlDispatcherA(ptr) +@ stdcall StartServiceCtrlDispatcherW(ptr) +@ stdcall StartServiceW(long long ptr) +@ stdcall StartTraceA(ptr str ptr) +@ stdcall StartTraceW(ptr wstr ptr) +@ stdcall StopTraceW(int64 wstr ptr) +@ stub SubscribeServiceChangeNotifications +@ stub TraceQueryInformation +@ stdcall TraceSetInformation(int64 long ptr long) +@ stub UnsubscribeServiceChangeNotifications +@ stub WaitServiceState diff --git a/wrappers/new-dlls/sechost/security.c b/wrappers/new-dlls/sechost/security.c new file mode 100644 index 00000000000..b6731b1fe1c --- /dev/null +++ b/wrappers/new-dlls/sechost/security.c @@ -0,0 +1,1235 @@ +/* + * Security API + * + * Copyright 2003 CodeWeavers Inc. (Ulrich Czekalla) + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include "windef.h" +#include "winbase.h" +#include "sddl.h" +#include "iads.h" + +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(security); + +static const struct +{ + WCHAR str[3]; + DWORD value; +} +ace_rights[] = +{ + { L"GA", GENERIC_ALL }, + { L"GR", GENERIC_READ }, + { L"GW", GENERIC_WRITE }, + { L"GX", GENERIC_EXECUTE }, + + { L"RC", READ_CONTROL }, + { L"SD", DELETE }, + { L"WD", WRITE_DAC }, + { L"WO", WRITE_OWNER }, + + { L"RP", ADS_RIGHT_DS_READ_PROP }, + { L"WP", ADS_RIGHT_DS_WRITE_PROP }, + { L"CC", ADS_RIGHT_DS_CREATE_CHILD }, + { L"DC", ADS_RIGHT_DS_DELETE_CHILD }, + { L"LC", ADS_RIGHT_ACTRL_DS_LIST }, + { L"SW", ADS_RIGHT_DS_SELF }, + { L"LO", ADS_RIGHT_DS_LIST_OBJECT }, + { L"DT", ADS_RIGHT_DS_DELETE_TREE }, + { L"CR", ADS_RIGHT_DS_CONTROL_ACCESS }, + + { L"FA", FILE_ALL_ACCESS }, + { L"FR", FILE_GENERIC_READ }, + { L"FW", FILE_GENERIC_WRITE }, + { L"FX", FILE_GENERIC_EXECUTE }, + + { L"KA", KEY_ALL_ACCESS }, + { L"KR", KEY_READ }, + { L"KW", KEY_WRITE }, + { L"KX", KEY_EXECUTE }, + + { L"NR", SYSTEM_MANDATORY_LABEL_NO_READ_UP }, + { L"NW", SYSTEM_MANDATORY_LABEL_NO_WRITE_UP }, + { L"NX", SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP }, +}; + +struct max_sid +{ + /* same fields as struct _SID */ + BYTE Revision; + BYTE SubAuthorityCount; + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; + DWORD SubAuthority[SID_MAX_SUB_AUTHORITIES]; +}; + +static const struct +{ + WCHAR str[2]; + WELL_KNOWN_SID_TYPE Type; + struct max_sid sid; +} +well_known_sids[] = +{ + { {0,0}, WinNullSid, { SID_REVISION, 1, { SECURITY_NULL_SID_AUTHORITY }, { SECURITY_NULL_RID } } }, + { {'W','D'}, WinWorldSid, { SID_REVISION, 1, { SECURITY_WORLD_SID_AUTHORITY }, { SECURITY_WORLD_RID } } }, + { {0,0}, WinLocalSid, { SID_REVISION, 1, { SECURITY_LOCAL_SID_AUTHORITY }, { SECURITY_LOCAL_RID } } }, + { {'C','O'}, WinCreatorOwnerSid, { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_OWNER_RID } } }, + { {'C','G'}, WinCreatorGroupSid, { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_GROUP_RID } } }, + { {'O','W'}, WinCreatorOwnerRightsSid, { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_OWNER_RIGHTS_RID } } }, + { {0,0}, WinCreatorOwnerServerSid, { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_OWNER_SERVER_RID } } }, + { {0,0}, WinCreatorGroupServerSid, { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_GROUP_SERVER_RID } } }, + { {0,0}, WinNtAuthoritySid, { SID_REVISION, 0, { SECURITY_NT_AUTHORITY }, { SECURITY_NULL_RID } } }, + { {0,0}, WinDialupSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_DIALUP_RID } } }, + { {'N','U'}, WinNetworkSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_NETWORK_RID } } }, + { {0,0}, WinBatchSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_BATCH_RID } } }, + { {'I','U'}, WinInteractiveSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_INTERACTIVE_RID } } }, + { {'S','U'}, WinServiceSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_SERVICE_RID } } }, + { {'A','N'}, WinAnonymousSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_ANONYMOUS_LOGON_RID } } }, + { {0,0}, WinProxySid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_PROXY_RID } } }, + { {'E','D'}, WinEnterpriseControllersSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_ENTERPRISE_CONTROLLERS_RID } } }, + { {'P','S'}, WinSelfSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_PRINCIPAL_SELF_RID } } }, + { {'A','U'}, WinAuthenticatedUserSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_AUTHENTICATED_USER_RID } } }, + { {'R','C'}, WinRestrictedCodeSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_RESTRICTED_CODE_RID } } }, + { {0,0}, WinTerminalServerSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_TERMINAL_SERVER_RID } } }, + { {0,0}, WinRemoteLogonIdSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_REMOTE_LOGON_RID } } }, + { {0,0}, WinLogonIdsSid, { SID_REVISION, SECURITY_LOGON_IDS_RID_COUNT, { SECURITY_NT_AUTHORITY }, { SECURITY_LOGON_IDS_RID } } }, + { {'S','Y'}, WinLocalSystemSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_LOCAL_SYSTEM_RID } } }, + { {'L','S'}, WinLocalServiceSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_LOCAL_SERVICE_RID } } }, + { {'N','S'}, WinNetworkServiceSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_NETWORK_SERVICE_RID } } }, + { {0,0}, WinBuiltinDomainSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID } } }, + { {'B','A'}, WinBuiltinAdministratorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } } }, + { {'B','U'}, WinBuiltinUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } } }, + { {'B','G'}, WinBuiltinGuestsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_GUESTS } } }, + { {'P','U'}, WinBuiltinPowerUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS } } }, + { {'A','O'}, WinBuiltinAccountOperatorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ACCOUNT_OPS } } }, + { {'S','O'}, WinBuiltinSystemOperatorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_SYSTEM_OPS } } }, + { {'P','O'}, WinBuiltinPrintOperatorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_PRINT_OPS } } }, + { {'B','O'}, WinBuiltinBackupOperatorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_BACKUP_OPS } } }, + { {'R','E'}, WinBuiltinReplicatorSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_REPLICATOR } } }, + { {'R','U'}, WinBuiltinPreWindows2000CompatibleAccessSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_PREW2KCOMPACCESS } } }, + { {'R','D'}, WinBuiltinRemoteDesktopUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS } } }, + { {'N','O'}, WinBuiltinNetworkConfigurationOperatorsSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS } } }, + { {0,0}, WinNTLMAuthenticationSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_PACKAGE_BASE_RID, SECURITY_PACKAGE_NTLM_RID } } }, + { {0,0}, WinDigestAuthenticationSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_PACKAGE_BASE_RID, SECURITY_PACKAGE_DIGEST_RID } } }, + { {0,0}, WinSChannelAuthenticationSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_PACKAGE_BASE_RID, SECURITY_PACKAGE_SCHANNEL_RID } } }, + { {0,0}, WinThisOrganizationSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_THIS_ORGANIZATION_RID } } }, + { {0,0}, WinOtherOrganizationSid, { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_OTHER_ORGANIZATION_RID } } }, + { {0,0}, WinBuiltinIncomingForestTrustBuildersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS } } }, + { {0,0}, WinBuiltinPerfMonitoringUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_MONITORING_USERS } } }, + { {0,0}, WinBuiltinPerfLoggingUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_LOGGING_USERS } } }, + { {0,0}, WinBuiltinAuthorizationAccessSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS } } }, + { {0,0}, WinBuiltinTerminalServerLicenseServersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS } } }, + { {0,0}, WinBuiltinDCOMUsersSid, { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_DCOM_USERS } } }, + { {'L','W'}, WinLowLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_LOW_RID} } }, + { {'M','E'}, WinMediumLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_MEDIUM_RID } } }, + { {'H','I'}, WinHighLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_HIGH_RID } } }, + { {'S','I'}, WinSystemLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_SYSTEM_RID } } }, + { {'A','C'}, WinBuiltinAnyPackageSid, { SID_REVISION, 2, { SECURITY_APP_PACKAGE_AUTHORITY }, { SECURITY_APP_PACKAGE_BASE_RID, SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE } } }, +}; + +/* these SIDs must be constructed as relative to some domain - only the RID is well-known */ +static const struct +{ + WCHAR str[2]; + WELL_KNOWN_SID_TYPE type; + DWORD rid; +} +well_known_rids[] = +{ + { {'L','A'}, WinAccountAdministratorSid, DOMAIN_USER_RID_ADMIN }, + { {'L','G'}, WinAccountGuestSid, DOMAIN_USER_RID_GUEST }, + { {0,0}, WinAccountKrbtgtSid, DOMAIN_USER_RID_KRBTGT }, + { {'D','A'}, WinAccountDomainAdminsSid, DOMAIN_GROUP_RID_ADMINS }, + { {'D','U'}, WinAccountDomainUsersSid, DOMAIN_GROUP_RID_USERS }, + { {'D','G'}, WinAccountDomainGuestsSid, DOMAIN_GROUP_RID_GUESTS }, + { {'D','C'}, WinAccountComputersSid, DOMAIN_GROUP_RID_COMPUTERS }, + { {'D','D'}, WinAccountControllersSid, DOMAIN_GROUP_RID_CONTROLLERS }, + { {'C','A'}, WinAccountCertAdminsSid, DOMAIN_GROUP_RID_CERT_ADMINS }, + { {'S','A'}, WinAccountSchemaAdminsSid, DOMAIN_GROUP_RID_SCHEMA_ADMINS }, + { {'E','A'}, WinAccountEnterpriseAdminsSid, DOMAIN_GROUP_RID_ENTERPRISE_ADMINS }, + { {'P','A'}, WinAccountPolicyAdminsSid, DOMAIN_GROUP_RID_POLICY_ADMINS }, + { {'R','S'}, WinAccountRasAndIasServersSid, DOMAIN_ALIAS_RID_RAS_SERVERS }, +}; + + +static void print_string(const WCHAR *string, int cch, WCHAR **pwptr, ULONG *plen) +{ + if (cch == -1) + cch = wcslen(string); + + if (plen) + *plen += cch; + + if (pwptr) + { + memcpy(*pwptr, string, sizeof(WCHAR)*cch); + *pwptr += cch; + } +} + +static BOOL print_sid_numeric(PSID psid, WCHAR **pwptr, ULONG *plen) +{ + DWORD i; + WCHAR buf[26]; + SID *pisid = psid; + + if( !IsValidSid( psid ) || pisid->Revision != SDDL_REVISION) + { + SetLastError(ERROR_INVALID_SID); + return FALSE; + } + + if (pisid->IdentifierAuthority.Value[0] || + pisid->IdentifierAuthority.Value[1]) + { + FIXME("not matching MS' bugs\n"); + SetLastError(ERROR_INVALID_SID); + return FALSE; + } + + swprintf( buf, ARRAY_SIZE(buf), L"S-%u-%d", pisid->Revision, MAKELONG( + MAKEWORD( pisid->IdentifierAuthority.Value[5], pisid->IdentifierAuthority.Value[4] ), + MAKEWORD( pisid->IdentifierAuthority.Value[3], pisid->IdentifierAuthority.Value[2] ) + ) ); + print_string(buf, -1, pwptr, plen); + + for( i=0; iSubAuthorityCount; i++ ) + { + swprintf( buf, ARRAY_SIZE(buf), L"-%u", pisid->SubAuthority[i] ); + print_string(buf, -1, pwptr, plen); + } + return TRUE; +} + +/****************************************************************************** + * ConvertSidToStringSidW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ConvertSidToStringSidW( PSID sid, WCHAR **pstr ) +{ + DWORD len = 0; + WCHAR *wstr, *wptr; + + TRACE("%p %p\n", sid, pstr ); + + len = 0; + if (!print_sid_numeric( sid, NULL, &len )) + return FALSE; + wstr = wptr = LocalAlloc( 0, (len + 1) * sizeof(WCHAR) ); + print_sid_numeric( sid, &wptr, NULL ); + *wptr = 0; + + *pstr = wstr; + return TRUE; +} + +static BOOL print_sid(PSID psid, WCHAR **pwptr, ULONG *plen) +{ + size_t i; + for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) + { + if (well_known_sids[i].str[0] && EqualSid(psid, (PSID)&well_known_sids[i].sid.Revision)) + { + print_string(well_known_sids[i].str, 2, pwptr, plen); + return TRUE; + } + } + + return print_sid_numeric(psid, pwptr, plen); +} + +static void print_rights(DWORD mask, WCHAR **pwptr, ULONG *plen) +{ + static const WCHAR *bit_names[32] = + { + L"CC", /* 0 */ + L"DC", + L"LC", + L"SW", + L"RP", /* 4 */ + L"WP", + L"DT", + L"LO", + L"CR", /* 8 */ + NULL, + NULL, + NULL, + NULL, /* 12 */ + NULL, + NULL, + NULL, + L"SD", /* 16 */ + L"RC", + L"WD", + L"WO", + NULL, /* 20 */ + NULL, + NULL, + NULL, + NULL, /* 24 */ + NULL, + NULL, + NULL, + L"GA", /* 28 */ + L"GX", + L"GW", + L"GR", + }; + + WCHAR buf[15]; + size_t i; + + if (mask == 0) + return; + + /* first check if the right have name */ + for (i = 0; i < ARRAY_SIZE(ace_rights); i++) + { + if (mask == ace_rights[i].value) + { + print_string(ace_rights[i].str, -1, pwptr, plen); + return; + } + } + + /* then check if it can be built from bit names */ + for (i = 0; i < 32; i++) + { + if ((mask & (1 << i)) && !bit_names[i]) + { + /* can't be built from bit names */ + swprintf(buf, ARRAY_SIZE(buf), L"0x%x", mask); + print_string(buf, -1, pwptr, plen); + return; + } + } + + /* build from bit names */ + for (i = 0; i < 32; i++) + if (mask & (1 << i)) + print_string(bit_names[i], -1, pwptr, plen); +} + +static inline BOOL is_object_ace(BYTE type) +{ + switch (type) + { + case ACCESS_ALLOWED_OBJECT_ACE_TYPE: + case ACCESS_DENIED_OBJECT_ACE_TYPE: + case ACCESS_AUDIT_OBJECT_ACE_TYPE: + case ACCESS_ALARM_OBJECT_ACE_TYPE: + case ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: + case ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: + case SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: + case SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: + return TRUE; + + default: + return FALSE; + } +} + +static BOOL print_ace(void *pace, WCHAR **pwptr, ULONG *plen) +{ + ACCESS_ALLOWED_ACE *piace; /* all the supported ACEs have the same memory layout */ + DWORD *sid_start; + + piace = pace; + + if (piace->Header.AceType > ACCESS_MAX_MS_V5_ACE_TYPE || piace->Header.AceSize < sizeof(ACCESS_ALLOWED_ACE)) + { + SetLastError(ERROR_INVALID_ACL); + return FALSE; + } + + print_string(L"(", -1, pwptr, plen); + switch (piace->Header.AceType) + { + case ACCESS_ALLOWED_ACE_TYPE: + print_string(L"A", -1, pwptr, plen); + break; + case ACCESS_DENIED_ACE_TYPE: + print_string(L"D", -1, pwptr, plen); + break; + case SYSTEM_AUDIT_ACE_TYPE: + print_string(L"AU", -1, pwptr, plen); + break; + case SYSTEM_ALARM_ACE_TYPE: + print_string(L"AL", -1, pwptr, plen); + break; + } + print_string(L";", -1, pwptr, plen); + + if (piace->Header.AceFlags & OBJECT_INHERIT_ACE) + print_string(L"OI", -1, pwptr, plen); + if (piace->Header.AceFlags & CONTAINER_INHERIT_ACE) + print_string(L"CI", -1, pwptr, plen); + if (piace->Header.AceFlags & NO_PROPAGATE_INHERIT_ACE) + print_string(L"NP", -1, pwptr, plen); + if (piace->Header.AceFlags & INHERIT_ONLY_ACE) + print_string(L"IO", -1, pwptr, plen); + if (piace->Header.AceFlags & INHERITED_ACE) + print_string(L"ID", -1, pwptr, plen); + if (piace->Header.AceFlags & SUCCESSFUL_ACCESS_ACE_FLAG) + print_string(L"SA", -1, pwptr, plen); + if (piace->Header.AceFlags & FAILED_ACCESS_ACE_FLAG) + print_string(L"FA", -1, pwptr, plen); + print_string(L";", -1, pwptr, plen); + print_rights(piace->Mask, pwptr, plen); + print_string(L";", -1, pwptr, plen); + sid_start = &piace->SidStart; + if (is_object_ace(piace->Header.AceType)) + { + ACCESS_ALLOWED_OBJECT_ACE *objace = pace; + + sid_start++; /* Flags */ + if (objace->Flags & ACE_OBJECT_TYPE_PRESENT) + sid_start += sizeof(GUID) / sizeof(*sid_start); /* ObjectType */ + if (objace->Flags & ACE_INHERITED_OBJECT_TYPE_PRESENT) + sid_start += sizeof(GUID) / sizeof(*sid_start); /* InheritedObjectType */ + } + /* objects not supported */ + print_string(L";", -1, pwptr, plen); + /* objects not supported */ + print_string(L";", -1, pwptr, plen); + if (!print_sid(sid_start, pwptr, plen)) + return FALSE; + print_string(L")", -1, pwptr, plen); + return TRUE; +} + +static BOOL print_acl(ACL *pacl, WCHAR **pwptr, ULONG *plen, SECURITY_DESCRIPTOR_CONTROL control) +{ + WORD count; + UINT i; + + if (control & SE_DACL_PROTECTED) + print_string(L"P", -1, pwptr, plen); + if (control & SE_DACL_AUTO_INHERIT_REQ) + print_string(L"AR", -1, pwptr, plen); + if (control & SE_DACL_AUTO_INHERITED) + print_string(L"AI", -1, pwptr, plen); + + if (pacl == NULL) + return TRUE; + + if (!IsValidAcl(pacl)) + return FALSE; + + count = pacl->AceCount; + for (i = 0; i < count; i++) + { + void *ace; + if (!GetAce(pacl, i, &ace)) + return FALSE; + if (!print_ace(ace, pwptr, plen)) + return FALSE; + } + + return TRUE; +} + +static BOOL print_owner(PSECURITY_DESCRIPTOR sd, WCHAR **pwptr, ULONG *plen) +{ + BOOL defaulted; + PSID psid; + + if (!GetSecurityDescriptorOwner(sd, &psid, &defaulted)) + return FALSE; + + if (psid == NULL) + return TRUE; + + print_string(L"O:", -1, pwptr, plen); + if (!print_sid(psid, pwptr, plen)) + return FALSE; + return TRUE; +} + +static BOOL print_group(PSECURITY_DESCRIPTOR sd, WCHAR **pwptr, ULONG *plen) +{ + BOOL defaulted; + PSID psid; + + if (!GetSecurityDescriptorGroup(sd, &psid, &defaulted)) + return FALSE; + + if (psid == NULL) + return TRUE; + + print_string(L"G:", -1, pwptr, plen); + if (!print_sid(psid, pwptr, plen)) + return FALSE; + return TRUE; +} + +static BOOL print_dacl(PSECURITY_DESCRIPTOR sd, WCHAR **pwptr, ULONG *plen) +{ + SECURITY_DESCRIPTOR_CONTROL control; + BOOL present, defaulted; + DWORD revision; + ACL *pacl; + + if (!GetSecurityDescriptorDacl(sd, &present, &pacl, &defaulted)) + return FALSE; + + if (!GetSecurityDescriptorControl(sd, &control, &revision)) + return FALSE; + + if (!present) + return TRUE; + + print_string(L"D:", -1, pwptr, plen); + if (!print_acl(pacl, pwptr, plen, control)) + return FALSE; + return TRUE; +} + +static BOOL print_sacl(PSECURITY_DESCRIPTOR sd, WCHAR **pwptr, ULONG *plen) +{ + SECURITY_DESCRIPTOR_CONTROL control; + BOOL present, defaulted; + DWORD revision; + ACL *pacl; + + if (!GetSecurityDescriptorSacl(sd, &present, &pacl, &defaulted)) + return FALSE; + + if (!GetSecurityDescriptorControl(sd, &control, &revision)) + return FALSE; + + if (!present) + return TRUE; + + print_string(L"S:", -1, pwptr, plen); + if (!print_acl(pacl, pwptr, plen, control)) + return FALSE; + return TRUE; +} + +/****************************************************************************** + * ConvertSecurityDescriptorToStringSecurityDescriptorW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ConvertSecurityDescriptorToStringSecurityDescriptorW( PSECURITY_DESCRIPTOR sd, + DWORD revision, SECURITY_INFORMATION flags, WCHAR **string, ULONG *ret_len ) +{ + ULONG len = 0; + WCHAR *wptr, *wstr; + + if (revision != SDDL_REVISION_1) + { + ERR("Unhandled SDDL revision %d\n", revision); + SetLastError( ERROR_UNKNOWN_REVISION ); + return FALSE; + } + + if ((flags & OWNER_SECURITY_INFORMATION) && !print_owner(sd, NULL, &len)) + return FALSE; + if ((flags & GROUP_SECURITY_INFORMATION) && !print_group(sd, NULL, &len)) + return FALSE; + if ((flags & DACL_SECURITY_INFORMATION) && !print_dacl(sd, NULL, &len)) + return FALSE; + if ((flags & SACL_SECURITY_INFORMATION) && !print_sacl(sd, NULL, &len)) + return FALSE; + + wstr = wptr = LocalAlloc( 0, (len + 1) * sizeof(WCHAR) ); + if ((flags & OWNER_SECURITY_INFORMATION) && !print_owner(sd, &wptr, NULL)) + { + LocalFree(wstr); + return FALSE; + } + if ((flags & GROUP_SECURITY_INFORMATION) && !print_group(sd, &wptr, NULL)) + { + LocalFree(wstr); + return FALSE; + } + if ((flags & DACL_SECURITY_INFORMATION) && !print_dacl(sd, &wptr, NULL)) + { + LocalFree(wstr); + return FALSE; + } + if ((flags & SACL_SECURITY_INFORMATION) && !print_sacl(sd, &wptr, NULL)) + { + LocalFree(wstr); + return FALSE; + } + *wptr = 0; + + TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len); + *string = wstr; + if (ret_len) *ret_len = wcslen(*string) + 1; + return TRUE; +} + +static BOOL get_computer_sid( PSID sid ) +{ + static const struct /* same fields as struct SID */ + { + BYTE Revision; + BYTE SubAuthorityCount; + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; + DWORD SubAuthority[4]; + } computer_sid = + { SID_REVISION, 4, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0 } }; + + memcpy( sid, &computer_sid, sizeof(computer_sid) ); + return TRUE; +} + +static DWORD get_sid_size( const WCHAR *string ) +{ + if (string[0] == 'S' && string[1] == '-') /* S-R-I(-S)+ */ + { + int token_count = 0; + while (*string) + { + if (*string == '-') + token_count++; + string++; + } + + if (token_count >= 3) + return GetSidLengthRequired( token_count - 2 ); + } + else /* String constant format - Only available in winxp and above */ + { + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) + { + if (!wcsncmp( well_known_sids[i].str, string, 2 )) + return GetSidLengthRequired( well_known_sids[i].sid.SubAuthorityCount ); + } + + for (i = 0; i < ARRAY_SIZE(well_known_rids); i++) + { + if (!wcsncmp( well_known_rids[i].str, string, 2 )) + { + struct max_sid local; + get_computer_sid(&local); + return GetSidLengthRequired( *GetSidSubAuthorityCount(&local) + 1 ); + } + } + } + + return GetSidLengthRequired( 0 ); +} + +static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) +{ + while (*string == ' ') + string++; + + *size = get_sid_size( string ); + if (!pisid) /* Simply compute the size */ + return TRUE; + + if (string[0] == 'S' && string[1] == '-') /* S-R-I-S-S */ + { + DWORD i = 0, identAuth; + DWORD csubauth = ((*size - GetSidLengthRequired(0)) / sizeof(DWORD)); + + string += 2; /* Advance to Revision */ + pisid->Revision = wcstoul( string, NULL, 10 ); + + if (pisid->Revision != SDDL_REVISION) + { + TRACE("Revision %d is unknown\n", pisid->Revision); + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } + if (csubauth == 0) + { + TRACE("SubAuthorityCount is 0\n"); + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } + + pisid->SubAuthorityCount = csubauth; + + /* Advance to identifier authority */ + while (*string && *string != '-') + string++; + if (*string == '-') + string++; + + /* MS' implementation can't handle values greater than 2^32 - 1, so + * we don't either; assume most significant bytes are always 0 + */ + pisid->IdentifierAuthority.Value[0] = 0; + pisid->IdentifierAuthority.Value[1] = 0; + identAuth = wcstoul( string, NULL, 10 ); + pisid->IdentifierAuthority.Value[5] = identAuth & 0xff; + pisid->IdentifierAuthority.Value[4] = (identAuth & 0xff00) >> 8; + pisid->IdentifierAuthority.Value[3] = (identAuth & 0xff0000) >> 16; + pisid->IdentifierAuthority.Value[2] = (identAuth & 0xff000000) >> 24; + + /* Advance to first sub authority */ + while (*string && *string != '-') + string++; + if (*string == '-') + string++; + + while (*string) + { + pisid->SubAuthority[i++] = wcstoul( string, NULL, 10 ); + + while (*string && *string != '-') + string++; + if (*string == '-') + string++; + } + + if (i != pisid->SubAuthorityCount) + { + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } + + return TRUE; + } + else /* String constant format - Only available in winxp and above */ + { + unsigned int i; + pisid->Revision = SDDL_REVISION; + + for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) + { + if (!wcsncmp(well_known_sids[i].str, string, 2)) + { + DWORD j; + pisid->SubAuthorityCount = well_known_sids[i].sid.SubAuthorityCount; + pisid->IdentifierAuthority = well_known_sids[i].sid.IdentifierAuthority; + for (j = 0; j < well_known_sids[i].sid.SubAuthorityCount; j++) + pisid->SubAuthority[j] = well_known_sids[i].sid.SubAuthority[j]; + return TRUE; + } + } + + for (i = 0; i < ARRAY_SIZE(well_known_rids); i++) + { + if (!wcsncmp(well_known_rids[i].str, string, 2)) + { + get_computer_sid(pisid); + pisid->SubAuthority[pisid->SubAuthorityCount] = well_known_rids[i].rid; + pisid->SubAuthorityCount++; + return TRUE; + } + } + + FIXME("String constant not supported: %s\n", debugstr_wn(string, 2)); + SetLastError( ERROR_INVALID_SID ); + return FALSE; + } +} + +/****************************************************************************** + * ConvertStringSidToSidW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidW( const WCHAR *string, PSID *sid ) +{ + DWORD size; + + TRACE("%s, %p\n", debugstr_w(string), sid); + + if (GetVersion() & 0x80000000) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } + + if (!string || !sid) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!parse_sid( string, NULL, &size )) + return FALSE; + + *sid = LocalAlloc( 0, size ); + + if (!parse_sid( string, *sid, &size )) + { + LocalFree( *sid ); + return FALSE; + } + return TRUE; +} + +static DWORD parse_acl_flags( const WCHAR **string_ptr ) +{ + DWORD flags = 0; + const WCHAR *string = *string_ptr; + + while (*string && *string != '(') + { + if (*string == 'P') + { + flags |= SE_DACL_PROTECTED; + } + else if (*string == 'A') + { + string++; + if (*string == 'R') + flags |= SE_DACL_AUTO_INHERIT_REQ; + else if (*string == 'I') + flags |= SE_DACL_AUTO_INHERITED; + } + string++; + } + + *string_ptr = string; + return flags; +} + +static BYTE parse_ace_type( const WCHAR **string_ptr ) +{ + static const struct + { + const WCHAR *str; + DWORD value; + } + ace_types[] = + { + { L"AL", SYSTEM_ALARM_ACE_TYPE }, + { L"AU", SYSTEM_AUDIT_ACE_TYPE }, + { L"A", ACCESS_ALLOWED_ACE_TYPE }, + { L"D", ACCESS_DENIED_ACE_TYPE }, + { L"ML", SYSTEM_MANDATORY_LABEL_ACE_TYPE }, + /* + { ACCESS_ALLOWED_OBJECT_ACE_TYPE }, + { ACCESS_DENIED_OBJECT_ACE_TYPE }, + { SYSTEM_ALARM_OBJECT_ACE_TYPE }, + { SYSTEM_AUDIT_OBJECT_ACE_TYPE }, + */ + }; + + const WCHAR *string = *string_ptr; + unsigned int i; + + while (*string == ' ') + string++; + + for (i = 0; i < ARRAY_SIZE(ace_types); ++i) + { + size_t len = wcslen( ace_types[i].str ); + if (!wcsncmp( string, ace_types[i].str, len )) + { + *string_ptr = string + len; + return ace_types[i].value; + } + } + return 0; +} + +static DWORD parse_ace_flag( const WCHAR *string ) +{ + static const struct + { + WCHAR str[3]; + DWORD value; + } + ace_flags[] = + { + { L"CI", CONTAINER_INHERIT_ACE }, + { L"FA", FAILED_ACCESS_ACE_FLAG }, + { L"ID", INHERITED_ACE }, + { L"IO", INHERIT_ONLY_ACE }, + { L"NP", NO_PROPAGATE_INHERIT_ACE }, + { L"OI", OBJECT_INHERIT_ACE }, + { L"SA", SUCCESSFUL_ACCESS_ACE_FLAG }, + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(ace_flags); ++i) + { + if (!wcsncmp( string, ace_flags[i].str, 2 )) + return ace_flags[i].value; + } + return 0; +} + +static DWORD parse_ace_right( const WCHAR **string_ptr ) +{ + const WCHAR *string = *string_ptr; + unsigned int i; + + if (string[0] == '0' && string[1] == 'x') + return wcstoul( string, (WCHAR **)string_ptr, 16 ); + + for (i = 0; i < ARRAY_SIZE(ace_rights); ++i) + { + if (!wcsncmp( string, ace_rights[i].str, 2 )) + { + *string_ptr += 2; + return ace_rights[i].value; + } + } + return 0; +} + +static BYTE parse_ace_flags( const WCHAR **string_ptr ) +{ + const WCHAR *string = *string_ptr; + BYTE flags = 0; + + while (*string == ' ') + string++; + + while (*string != ';') + { + DWORD flag = parse_ace_flag( string ); + if (!flag) return 0; + flags |= flag; + string += 2; + } + + *string_ptr = string; + return flags; +} + +static DWORD parse_ace_rights( const WCHAR **string_ptr ) +{ + DWORD rights = 0; + const WCHAR *string = *string_ptr; + + while (*string == ' ') + string++; + + while (*string != ';') + { + DWORD right = parse_ace_right( &string ); + if (!right) return 0; + rights |= right; + } + + *string_ptr = string; + return rights; +} + +static BOOL parse_acl( const WCHAR *string, DWORD *flags, ACL *acl, DWORD *ret_size ) +{ + DWORD val; + DWORD sidlen; + DWORD length = sizeof(ACL); + DWORD acesize = 0; + DWORD acecount = 0; + ACCESS_ALLOWED_ACE *ace = NULL; /* pointer to current ACE */ + + TRACE("%s\n", debugstr_w(string)); + + if (acl) /* ace is only useful if we're setting values */ + ace = (ACCESS_ALLOWED_ACE *)(acl + 1); + + /* Parse ACL flags */ + *flags = parse_acl_flags( &string ); + + /* Parse ACE */ + while (*string == '(') + { + string++; + + /* Parse ACE type */ + val = parse_ace_type( &string ); + if (ace) + ace->Header.AceType = val; + if (*string != ';') + { + SetLastError( RPC_S_INVALID_STRING_UUID ); + return FALSE; + } + string++; + + /* Parse ACE flags */ + val = parse_ace_flags( &string ); + if (ace) + ace->Header.AceFlags = val; + if (*string != ';') + goto err; + string++; + + /* Parse ACE rights */ + val = parse_ace_rights( &string ); + if (ace) + ace->Mask = val; + if (*string != ';') + goto err; + string++; + + /* Parse ACE object guid */ + while (*string == ' ') + string++; + if (*string != ';') + { + FIXME("Support for *_OBJECT_ACE_TYPE not implemented\n"); + goto err; + } + string++; + + /* Parse ACE inherit object guid */ + while (*string == ' ') + string++; + if (*string != ';') + { + FIXME("Support for *_OBJECT_ACE_TYPE not implemented\n"); + goto err; + } + string++; + + /* Parse ACE account sid */ + if (parse_sid( string, ace ? (SID *)&ace->SidStart : NULL, &sidlen )) + { + while (*string && *string != ')') + string++; + } + + if (*string != ')') + goto err; + string++; + + acesize = sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) + sidlen; + length += acesize; + if (ace) + { + ace->Header.AceSize = acesize; + ace = (ACCESS_ALLOWED_ACE *)((BYTE *)ace + acesize); + } + acecount++; + } + + *ret_size = length; + + if (length > 0xffff) + { + ERR("ACL too large\n"); + goto err; + } + + if (acl) + { + acl->AclRevision = ACL_REVISION; + acl->Sbz1 = 0; + acl->AclSize = length; + acl->AceCount = acecount; + acl->Sbz2 = 0; + } + return TRUE; + +err: + SetLastError( ERROR_INVALID_ACL ); + WARN("Invalid ACE string format\n"); + return FALSE; +} + +static BOOL parse_sd( const WCHAR *string, SECURITY_DESCRIPTOR_RELATIVE *sd, DWORD *size) +{ + BOOL ret = FALSE; + WCHAR toktype; + WCHAR *tok; + const WCHAR *lptoken; + BYTE *next = NULL; + DWORD len; + + *size = sizeof(SECURITY_DESCRIPTOR_RELATIVE); + + tok = heap_alloc( (wcslen(string) + 1) * sizeof(WCHAR) ); + if (!tok) + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; + } + + if (sd) + next = (BYTE *)(sd + 1); + + while (*string == ' ') + string++; + + while (*string) + { + toktype = *string; + + /* Expect char identifier followed by ':' */ + string++; + if (*string != ':') + { + SetLastError( ERROR_INVALID_PARAMETER ); + goto out; + } + string++; + + /* Extract token */ + lptoken = string; + while (*lptoken && *lptoken != ':') + lptoken++; + + if (*lptoken) + lptoken--; + + len = lptoken - string; + memcpy( tok, string, len * sizeof(WCHAR) ); + tok[len] = 0; + + switch (toktype) + { + case 'O': + { + DWORD bytes; + + if (!parse_sid( tok, (SID *)next, &bytes )) + goto out; + + if (sd) + { + sd->Owner = next - (BYTE *)sd; + next += bytes; /* Advance to next token */ + } + + *size += bytes; + + break; + } + + case 'G': + { + DWORD bytes; + + if (!parse_sid( tok, (SID *)next, &bytes )) + goto out; + + if (sd) + { + sd->Group = next - (BYTE *)sd; + next += bytes; /* Advance to next token */ + } + + *size += bytes; + + break; + } + + case 'D': + { + DWORD flags; + DWORD bytes; + + if (!parse_acl( tok, &flags, (ACL *)next, &bytes )) + goto out; + + if (sd) + { + sd->Control |= SE_DACL_PRESENT | flags; + sd->Dacl = next - (BYTE *)sd; + next += bytes; /* Advance to next token */ + } + + *size += bytes; + + break; + } + + case 'S': + { + DWORD flags; + DWORD bytes; + + if (!parse_acl( tok, &flags, (ACL *)next, &bytes )) + goto out; + + if (sd) + { + sd->Control |= SE_SACL_PRESENT | flags; + sd->Sacl = next - (BYTE *)sd; + next += bytes; /* Advance to next token */ + } + + *size += bytes; + + break; + } + + default: + FIXME("Unknown token\n"); + SetLastError( ERROR_INVALID_PARAMETER ); + goto out; + } + + string = lptoken; + } + + ret = TRUE; + +out: + heap_free(tok); + return ret; +} + +/****************************************************************************** + * ConvertStringSecurityDescriptorToSecurityDescriptorW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescriptorW( + const WCHAR *string, DWORD revision, PSECURITY_DESCRIPTOR *sd, ULONG *ret_size ) +{ + DWORD size; + SECURITY_DESCRIPTOR *psd; + + TRACE("%s, %u, %p, %p\n", debugstr_w(string), revision, sd, ret_size); + + if (GetVersion() & 0x80000000) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } + if (!string || !sd) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (revision != SID_REVISION) + { + SetLastError(ERROR_UNKNOWN_REVISION); + return FALSE; + } + + /* Compute security descriptor length */ + if (!parse_sd( string, NULL, &size )) + return FALSE; + + psd = *sd = LocalAlloc( GMEM_ZEROINIT, size ); + if (!psd) + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; + } + + psd->Revision = SID_REVISION; + psd->Control |= SE_SELF_RELATIVE; + + if (!parse_sd( string, (SECURITY_DESCRIPTOR_RELATIVE *)psd, &size )) + { + LocalFree(psd); + return FALSE; + } + + if (ret_size) *ret_size = size; + return TRUE; +} diff --git a/wrappers/new-dlls/sechost/service.c b/wrappers/new-dlls/sechost/service.c new file mode 100644 index 00000000000..e4e152b0824 --- /dev/null +++ b/wrappers/new-dlls/sechost/service.c @@ -0,0 +1,2119 @@ +/* + * Service control API + * + * Copyright 1995 Sven Verdoolaege + * Copyright 2005 Mike McCormack + * Copyright 2007 Rolf Kalbermatter + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define NONAMELESSUNION +#include +#include "windef.h" +#include "winbase.h" +#include "winsvc.h" +#include "winternl.h" +#include "winuser.h" +#include "dbt.h" + +#include "wine/debug.h" +#include "wine/exception.h" +#include "wine/heap.h" +#include "wine/list.h" + +#include "svcctl.h" +#include "plugplay.h" + +WINE_DEFAULT_DEBUG_CHANNEL(service); + +struct notify_data +{ + SC_HANDLE service; + SC_RPC_NOTIFY_PARAMS params; + SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 cparams; + SC_NOTIFY_RPC_HANDLE notify_handle; + SERVICE_NOTIFYW *notify_buffer; + HANDLE calling_thread, ready_evt; + struct list entry; +}; + +static struct list notify_list = LIST_INIT(notify_list); + +static CRITICAL_SECTION service_cs; +static CRITICAL_SECTION_DEBUG service_cs_debug = +{ + 0, 0, &service_cs, + { &service_cs_debug.ProcessLocksList, + &service_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": service_cs") } +}; +static CRITICAL_SECTION service_cs = { &service_cs_debug, -1, 0, 0, 0, 0 }; + +struct service_data +{ + LPHANDLER_FUNCTION_EX handler; + void *context; + HANDLE thread; + SC_HANDLE handle; + SC_HANDLE full_access_handle; + unsigned int unicode : 1; + union + { + LPSERVICE_MAIN_FUNCTIONA a; + LPSERVICE_MAIN_FUNCTIONW w; + } proc; + WCHAR *args; + WCHAR name[1]; +}; + +struct dispatcher_data +{ + SC_HANDLE manager; + HANDLE pipe; +}; + +static struct service_data **services; +static unsigned int nb_services; +static HANDLE service_event; +static BOOL stop_service; + +static WCHAR *heap_strdupAtoW( const char *src ) +{ + WCHAR *dst = NULL; + if (src) + { + DWORD len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 ); + if ((dst = heap_alloc( len * sizeof(WCHAR) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len ); + } + return dst; +} + +static WCHAR *heap_strdup_multi_AtoW( const char *src ) +{ + WCHAR *dst = NULL; + const char *p = src; + DWORD len; + + if (!src) return NULL; + + while (*p) p += strlen(p) + 1; + for (p = src; *p; p += strlen(p) + 1); + p++; /* final null */ + len = MultiByteToWideChar( CP_ACP, 0, src, p - src, NULL, 0 ); + if ((dst = heap_alloc( len * sizeof(WCHAR) ))) MultiByteToWideChar( CP_ACP, 0, src, p - src, dst, len ); + return dst; +} + +static inline DWORD multisz_size( const WCHAR *str ) +{ + const WCHAR *p = str; + + if (!str) return 0; + + while (*p) p += wcslen(p) + 1; + return (p - str + 1) * sizeof(WCHAR); +} + +void __RPC_FAR * __RPC_USER MIDL_user_allocate( SIZE_T len ) +{ + return heap_alloc(len); +} + +void __RPC_USER MIDL_user_free( void __RPC_FAR *ptr ) +{ + heap_free(ptr); +} + +static LONG WINAPI rpc_filter( EXCEPTION_POINTERS *eptr ) +{ + return I_RpcExceptionFilter( eptr->ExceptionRecord->ExceptionCode ); +} + +static DWORD map_exception_code( DWORD exception_code ) +{ + switch (exception_code) + { + case RPC_X_NULL_REF_POINTER: + return ERROR_INVALID_ADDRESS; + case RPC_X_ENUM_VALUE_OUT_OF_RANGE: + case RPC_X_BYTE_COUNT_TOO_SMALL: + return ERROR_INVALID_PARAMETER; + case RPC_S_INVALID_BINDING: + case RPC_X_SS_IN_NULL_CONTEXT: + return ERROR_INVALID_HANDLE; + default: + return exception_code; + } +} + +static handle_t rpc_wstr_bind( RPC_WSTR str ) +{ + WCHAR transport[] = SVCCTL_TRANSPORT; + WCHAR endpoint[] = SVCCTL_ENDPOINT; + RPC_WSTR binding_str; + RPC_STATUS status; + handle_t rpc_handle; + + status = RpcStringBindingComposeW( NULL, transport, str, endpoint, NULL, &binding_str ); + if (status != RPC_S_OK) + { + ERR("RpcStringBindingComposeW failed, error %d\n", status); + return NULL; + } + + status = RpcBindingFromStringBindingW( binding_str, &rpc_handle ); + RpcStringFreeW( &binding_str ); + + if (status != RPC_S_OK) + { + ERR("Couldn't connect to services.exe, error %d\n", status); + return NULL; + } + + return rpc_handle; +} + +static handle_t rpc_cstr_bind(RPC_CSTR str) +{ + RPC_CSTR transport = (RPC_CSTR)SVCCTL_TRANSPORTA; + RPC_CSTR endpoint = (RPC_CSTR)SVCCTL_ENDPOINTA; + RPC_CSTR binding_str; + RPC_STATUS status; + handle_t rpc_handle; + + status = RpcStringBindingComposeA( NULL, transport, str, endpoint, NULL, &binding_str ); + if (status != RPC_S_OK) + { + ERR("RpcStringBindingComposeA failed, error %d\n", status); + return NULL; + } + + status = RpcBindingFromStringBindingA( binding_str, &rpc_handle ); + RpcStringFreeA( &binding_str ); + + if (status != RPC_S_OK) + { + ERR("Couldn't connect to services.exe, error %d\n", status); + return NULL; + } + + return rpc_handle; +} + +DECLSPEC_HIDDEN handle_t __RPC_USER MACHINE_HANDLEA_bind( MACHINE_HANDLEA name ) +{ + return rpc_cstr_bind( (RPC_CSTR)name ); +} + +DECLSPEC_HIDDEN void __RPC_USER MACHINE_HANDLEA_unbind( MACHINE_HANDLEA name, handle_t h ) +{ + RpcBindingFree( &h ); +} + +DECLSPEC_HIDDEN handle_t __RPC_USER MACHINE_HANDLEW_bind( MACHINE_HANDLEW name ) +{ + return rpc_wstr_bind( (RPC_WSTR)name ); +} + +DECLSPEC_HIDDEN void __RPC_USER MACHINE_HANDLEW_unbind( MACHINE_HANDLEW name, handle_t h ) +{ + RpcBindingFree( &h ); +} + +DECLSPEC_HIDDEN handle_t __RPC_USER SVCCTL_HANDLEW_bind( SVCCTL_HANDLEW name ) +{ + return rpc_wstr_bind( (RPC_WSTR)name ); +} + +DECLSPEC_HIDDEN void __RPC_USER SVCCTL_HANDLEW_unbind( SVCCTL_HANDLEW name, handle_t h ) +{ + RpcBindingFree( &h ); +} + +static BOOL set_error( DWORD err ) +{ + if (err) SetLastError( err ); + return !err; +} + +/****************************************************************************** + * OpenSCManagerA (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenSCManagerA( const char *machine, const char *database, DWORD access ) +{ + WCHAR *machineW, *databaseW; + SC_HANDLE ret; + + machineW = heap_strdupAtoW( machine ); + databaseW = heap_strdupAtoW( database ); + ret = OpenSCManagerW( machineW, databaseW, access ); + heap_free( databaseW ); + heap_free( machineW ); + return ret; +} + +/****************************************************************************** + * OpenSCManagerW (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenSCManagerW( const WCHAR *machine, const WCHAR *database, DWORD access ) +{ + SC_RPC_HANDLE handle = NULL; + DWORD err; + + TRACE( "%s %s %#x\n", debugstr_w(machine), debugstr_w(database), access ); + + __TRY + { + err = svcctl_OpenSCManagerW( machine, database, access, &handle ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (!err) return handle; + SetLastError( err ); + return NULL; +} + +/****************************************************************************** + * OpenServiceA (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceA( SC_HANDLE manager, const char *name, DWORD access ) +{ + WCHAR *nameW; + SC_HANDLE ret; + + TRACE( "%p %s %#x\n", manager, debugstr_a(name), access ); + + nameW = heap_strdupAtoW( name ); + ret = OpenServiceW( manager, nameW, access ); + heap_free( nameW ); + return ret; +} + +/****************************************************************************** + * OpenServiceW (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceW( SC_HANDLE manager, const WCHAR *name, DWORD access ) +{ + SC_RPC_HANDLE handle = NULL; + DWORD err; + + TRACE( "%p %s %#x\n", manager, debugstr_w(name), access ); + + if (!manager) + { + SetLastError( ERROR_INVALID_HANDLE ); + return NULL; + } + + __TRY + { + err = svcctl_OpenServiceW( manager, name, access, &handle ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (!err) return handle; + SetLastError( err ); + return 0; +} + +/****************************************************************************** + * CreateServiceA (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH CreateServiceA( SC_HANDLE manager, const char *name, const char *display_name, + DWORD access, DWORD service_type, DWORD start_type, + DWORD error_control, const char *path, const char *group, + DWORD *tag, const char *dependencies, const char *username, + const char *password ) +{ + WCHAR *nameW, *display_nameW, *pathW, *groupW, *dependenciesW, *usernameW, *passwordW; + SC_HANDLE handle; + + TRACE( "%p %s %s\n", manager, debugstr_a(name), debugstr_a(display_name) ); + + nameW = heap_strdupAtoW( name ); + display_nameW = heap_strdupAtoW( display_name ); + pathW = heap_strdupAtoW( path ); + groupW = heap_strdupAtoW( group ); + dependenciesW = heap_strdupAtoW( dependencies ); + usernameW = heap_strdupAtoW( username ); + passwordW = heap_strdupAtoW( password ); + + handle = CreateServiceW( manager, nameW, display_nameW, access, service_type, start_type, error_control, + pathW, groupW, tag, dependenciesW, usernameW, passwordW ); + + heap_free( nameW ); + heap_free( display_nameW ); + heap_free( pathW ); + heap_free( groupW ); + heap_free( dependenciesW ); + heap_free( usernameW ); + heap_free( passwordW ); + + return handle; +} + +/****************************************************************************** + * CreateServiceW (sechost.@) + */ +SC_HANDLE WINAPI DECLSPEC_HOTPATCH CreateServiceW( SC_HANDLE manager, const WCHAR *name, const WCHAR *display_name, + DWORD access, DWORD service_type, DWORD start_type, + DWORD error_control, const WCHAR *path, const WCHAR *group, + DWORD *tag, const WCHAR *dependencies, const WCHAR *username, + const WCHAR *password ) +{ + SC_RPC_HANDLE handle = NULL; + DWORD err; + SIZE_T password_size = 0; + + TRACE( "%p %s %s\n", manager, debugstr_w(name), debugstr_w(display_name) ); + + if (!manager) + { + SetLastError( ERROR_INVALID_HANDLE ); + return 0; + } + + if (password) password_size = (wcslen(password) + 1) * sizeof(WCHAR); + + __TRY + { + BOOL is_wow64; + + if (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64) + err = svcctl_CreateServiceWOW64W( manager, name, display_name, access, service_type, start_type, + error_control, path, group, tag, (const BYTE *)dependencies, + multisz_size( dependencies ), username, (const BYTE *)password, + password_size, &handle ); + else + err = svcctl_CreateServiceW( manager, name, display_name, access, service_type, start_type, + error_control, path, group, tag, (const BYTE *)dependencies, + multisz_size( dependencies ), username, (const BYTE *)password, + password_size, &handle ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (!err) return handle; + SetLastError( err ); + return NULL; +} + +/****************************************************************************** + * DeleteService (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH DeleteService( SC_HANDLE service ) +{ + DWORD err; + + TRACE( "%p\n", service ); + + __TRY + { + err = svcctl_DeleteService( service ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * CloseServiceHandle (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH CloseServiceHandle( SC_HANDLE handle ) +{ + DWORD err; + + TRACE( "%p\n", handle ); + + __TRY + { + err = svcctl_CloseServiceHandle( (SC_RPC_HANDLE *)&handle ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * ChangeServiceConfig2A (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ChangeServiceConfig2A( SC_HANDLE service, DWORD level, void *info) +{ + BOOL r = FALSE; + + TRACE( "%p %d %p\n", service, level, info ); + + if (level == SERVICE_CONFIG_DESCRIPTION) + { + SERVICE_DESCRIPTIONA *sd = info; + SERVICE_DESCRIPTIONW sdw; + + sdw.lpDescription = heap_strdupAtoW( sd->lpDescription ); + + r = ChangeServiceConfig2W( service, level, &sdw ); + + heap_free( sdw.lpDescription ); + } + else if (level == SERVICE_CONFIG_FAILURE_ACTIONS) + { + SERVICE_FAILURE_ACTIONSA *fa = info; + SERVICE_FAILURE_ACTIONSW faw; + + faw.dwResetPeriod = fa->dwResetPeriod; + faw.lpRebootMsg = heap_strdupAtoW( fa->lpRebootMsg ); + faw.lpCommand = heap_strdupAtoW( fa->lpCommand ); + faw.cActions = fa->cActions; + faw.lpsaActions = fa->lpsaActions; + + r = ChangeServiceConfig2W( service, level, &faw ); + + heap_free( faw.lpRebootMsg ); + heap_free( faw.lpCommand ); + } + else if (level == SERVICE_CONFIG_PRESHUTDOWN_INFO) + { + r = ChangeServiceConfig2W( service, level, info ); + } + else + SetLastError( ERROR_INVALID_PARAMETER ); + + return r; +} + +/****************************************************************************** + * ChangeServiceConfig2W (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ChangeServiceConfig2W( SC_HANDLE service, DWORD level, void *info ) +{ + SERVICE_RPC_REQUIRED_PRIVILEGES_INFO rpc_privinfo; + DWORD err; + + __TRY + { + SC_RPC_CONFIG_INFOW rpc_info; + + rpc_info.dwInfoLevel = level; + if (level == SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO) + { + SERVICE_REQUIRED_PRIVILEGES_INFOW *privinfo = info; + + rpc_privinfo.cbRequiredPrivileges = multisz_size( privinfo->pmszRequiredPrivileges ); + rpc_privinfo.pRequiredPrivileges = (BYTE *)privinfo->pmszRequiredPrivileges; + rpc_info.privinfo = &rpc_privinfo; + } + else + rpc_info.descr = info; + err = svcctl_ChangeServiceConfig2W( service, rpc_info ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * ChangeServiceConfigA (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ChangeServiceConfigA( SC_HANDLE service, DWORD service_type, DWORD start_type, + DWORD error_control, const char *path, const char *group, + DWORD *tag, const char *dependencies, const char *username, + const char *password, const char *display_name ) +{ + WCHAR *pathW, *groupW, *dependenciesW, *usernameW, *passwordW, *display_nameW; + BOOL r; + + TRACE( "%p %d %d %d %s %s %p %p %s %s %s\n", service, service_type, start_type, + error_control, debugstr_a(path), debugstr_a(group), tag, dependencies, + debugstr_a(username), debugstr_a(password), debugstr_a(display_name) ); + + pathW = heap_strdupAtoW( path ); + groupW = heap_strdupAtoW( group ); + dependenciesW = heap_strdup_multi_AtoW( dependencies ); + usernameW = heap_strdupAtoW( username ); + passwordW = heap_strdupAtoW( password ); + display_nameW = heap_strdupAtoW( display_name ); + + r = ChangeServiceConfigW( service, service_type, start_type, error_control, pathW, + groupW, tag, dependenciesW, usernameW, passwordW, display_nameW ); + + heap_free( pathW ); + heap_free( groupW ); + heap_free( dependenciesW ); + heap_free( usernameW ); + heap_free( passwordW ); + heap_free( display_nameW ); + + return r; +} + +/****************************************************************************** + * ChangeServiceConfigW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ChangeServiceConfigW( SC_HANDLE service, DWORD service_type, DWORD start_type, + DWORD error_control, const WCHAR *path, const WCHAR *group, + DWORD *tag, const WCHAR *dependencies, const WCHAR *username, + const WCHAR *password, const WCHAR *display_name ) +{ + DWORD password_size; + DWORD err; + + TRACE( "%p %d %d %d %s %s %p %p %s %s %s\n", service, service_type, start_type, + error_control, debugstr_w(path), debugstr_w(group), tag, dependencies, + debugstr_w(username), debugstr_w(password), debugstr_w(display_name) ); + + password_size = password ? (wcslen(password) + 1) * sizeof(WCHAR) : 0; + + __TRY + { + err = svcctl_ChangeServiceConfigW( service, service_type, start_type, error_control, path, group, tag, + (const BYTE *)dependencies, multisz_size(dependencies), username, + (const BYTE *)password, password_size, display_name ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * QueryServiceConfigA (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceConfigA( SC_HANDLE service, QUERY_SERVICE_CONFIGA *config, + DWORD size, DWORD *ret_size ) +{ + DWORD n; + char *p, *buffer; + BOOL ret; + QUERY_SERVICE_CONFIGW *configW; + + TRACE( "%p %p %d %p\n", service, config, size, ret_size ); + + if (!(buffer = heap_alloc( 2 * size ))) return set_error( ERROR_NOT_ENOUGH_MEMORY ); + configW = (QUERY_SERVICE_CONFIGW *)buffer; + ret = QueryServiceConfigW( service, configW, 2 * size, ret_size ); + if (!ret) goto done; + + config->dwServiceType = configW->dwServiceType; + config->dwStartType = configW->dwStartType; + config->dwErrorControl = configW->dwErrorControl; + config->lpBinaryPathName = NULL; + config->lpLoadOrderGroup = NULL; + config->dwTagId = configW->dwTagId; + config->lpDependencies = NULL; + config->lpServiceStartName = NULL; + config->lpDisplayName = NULL; + + p = (char *)(config + 1); + n = size - sizeof(*config); + ret = FALSE; + +#define MAP_STR(str) \ + do { \ + if (configW->str) \ + { \ + DWORD sz = WideCharToMultiByte( CP_ACP, 0, configW->str, -1, p, n, NULL, NULL ); \ + if (!sz) goto done; \ + config->str = p; \ + p += sz; \ + n -= sz; \ + } \ + } while (0) + + MAP_STR( lpBinaryPathName ); + MAP_STR( lpLoadOrderGroup ); + MAP_STR( lpDependencies ); + MAP_STR( lpServiceStartName ); + MAP_STR( lpDisplayName ); +#undef MAP_STR + + *ret_size = p - (char *)config; + ret = TRUE; + +done: + heap_free( buffer ); + return ret; +} + +static DWORD move_string_to_buffer(BYTE **buf, WCHAR **string_ptr) +{ + DWORD cb; + + if (!*string_ptr) + { + cb = sizeof(WCHAR); + memset(*buf, 0, cb); + } + else + { + cb = (wcslen( *string_ptr ) + 1) * sizeof(WCHAR); + memcpy(*buf, *string_ptr, cb); + MIDL_user_free( *string_ptr ); + } + + *string_ptr = (WCHAR *)*buf; + *buf += cb; + + return cb; +} + +static DWORD size_string( const WCHAR *string ) +{ + return (string ? (wcslen( string ) + 1) * sizeof(WCHAR) : sizeof(WCHAR)); +} + +/****************************************************************************** + * QueryServiceConfigW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceConfigW( SC_HANDLE service, QUERY_SERVICE_CONFIGW *ret_config, + DWORD size, DWORD *ret_size ) +{ + QUERY_SERVICE_CONFIGW config; + DWORD total; + DWORD err; + BYTE *bufpos; + + TRACE( "%p %p %d %p\n", service, ret_config, size, ret_size ); + + memset(&config, 0, sizeof(config)); + + __TRY + { + err = svcctl_QueryServiceConfigW( service, &config, size, ret_size ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (err) return set_error( err ); + + /* calculate the size required first */ + total = sizeof(QUERY_SERVICE_CONFIGW); + total += size_string( config.lpBinaryPathName ); + total += size_string( config.lpLoadOrderGroup ); + total += size_string( config.lpDependencies ); + total += size_string( config.lpServiceStartName ); + total += size_string( config.lpDisplayName ); + + *ret_size = total; + + /* if there's not enough memory, return an error */ + if (size < total) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + MIDL_user_free( config.lpBinaryPathName ); + MIDL_user_free( config.lpLoadOrderGroup ); + MIDL_user_free( config.lpDependencies ); + MIDL_user_free( config.lpServiceStartName ); + MIDL_user_free( config.lpDisplayName ); + return FALSE; + } + + *ret_config = config; + bufpos = ((BYTE *)ret_config) + sizeof(QUERY_SERVICE_CONFIGW); + move_string_to_buffer( &bufpos, &ret_config->lpBinaryPathName ); + move_string_to_buffer( &bufpos, &ret_config->lpLoadOrderGroup ); + move_string_to_buffer( &bufpos, &ret_config->lpDependencies ); + move_string_to_buffer( &bufpos, &ret_config->lpServiceStartName ); + move_string_to_buffer( &bufpos, &ret_config->lpDisplayName ); + + TRACE( "Image path = %s\n", debugstr_w( ret_config->lpBinaryPathName ) ); + TRACE( "Group = %s\n", debugstr_w( ret_config->lpLoadOrderGroup ) ); + TRACE( "Dependencies = %s\n", debugstr_w( ret_config->lpDependencies ) ); + TRACE( "Service account name = %s\n", debugstr_w( ret_config->lpServiceStartName ) ); + TRACE( "Display name = %s\n", debugstr_w( ret_config->lpDisplayName ) ); + + return TRUE; +} + +/****************************************************************************** + * QueryServiceConfig2A (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceConfig2A( SC_HANDLE service, DWORD level, BYTE *buffer, + DWORD size, DWORD *ret_size ) +{ + BYTE *bufferW = NULL; + + TRACE( "%p %u %p %u %p\n", service, level, buffer, size, ret_size ); + + if (buffer && size) + bufferW = heap_alloc( size ); + + if (!QueryServiceConfig2W( service, level, bufferW, size, ret_size )) + { + heap_free( bufferW ); + return FALSE; + } + + switch (level) + { + case SERVICE_CONFIG_DESCRIPTION: + if (buffer && bufferW) { + SERVICE_DESCRIPTIONA *configA = (SERVICE_DESCRIPTIONA *)buffer; + SERVICE_DESCRIPTIONW *configW = (SERVICE_DESCRIPTIONW *)bufferW; + if (configW->lpDescription && size > sizeof(SERVICE_DESCRIPTIONA)) + { + configA->lpDescription = (char *)(configA + 1); + WideCharToMultiByte( CP_ACP, 0, configW->lpDescription, -1, configA->lpDescription, + size - sizeof(SERVICE_DESCRIPTIONA), NULL, NULL ); + } + else configA->lpDescription = NULL; + } + break; + case SERVICE_CONFIG_PRESHUTDOWN_INFO: + if (buffer && bufferW && *ret_size <= size) + memcpy(buffer, bufferW, *ret_size); + break; + default: + FIXME("conversion W->A not implemented for level %d\n", level); + heap_free( bufferW ); + return FALSE; + } + + heap_free( bufferW ); + return TRUE; +} + +/****************************************************************************** + * QueryServiceConfig2W (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceConfig2W( SC_HANDLE service, DWORD level, BYTE *buffer, + DWORD size, DWORD *ret_size ) +{ + BYTE *bufptr; + DWORD err; + + TRACE( "%p %u %p %u %p\n", service, level, buffer, size, ret_size ); + + if (!buffer && size) + { + SetLastError(ERROR_INVALID_ADDRESS); + return FALSE; + } + + switch (level) + { + case SERVICE_CONFIG_DESCRIPTION: + if (!(bufptr = heap_alloc( size ))) + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; + } + break; + + case SERVICE_CONFIG_PRESHUTDOWN_INFO: + bufptr = buffer; + break; + + default: + FIXME("Level %d not implemented\n", level); + SetLastError(ERROR_INVALID_LEVEL); + return FALSE; + } + + if (!ret_size) + { + if (level == SERVICE_CONFIG_DESCRIPTION) heap_free( bufptr ); + SetLastError(ERROR_INVALID_ADDRESS); + return FALSE; + } + + __TRY + { + err = svcctl_QueryServiceConfig2W( service, level, bufptr, size, ret_size ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + switch (level) + { + case SERVICE_CONFIG_DESCRIPTION: + { + SERVICE_DESCRIPTIONW *desc = (SERVICE_DESCRIPTIONW *)buffer; + struct service_description *s = (struct service_description *)bufptr; + + if (err != ERROR_SUCCESS && err != ERROR_INSUFFICIENT_BUFFER) + { + heap_free( bufptr ); + SetLastError( err ); + return FALSE; + } + + /* adjust for potentially larger SERVICE_DESCRIPTIONW structure */ + if (*ret_size == sizeof(*s)) + *ret_size = sizeof(*desc); + else + *ret_size = *ret_size - FIELD_OFFSET(struct service_description, description) + sizeof(*desc); + + if (size < *ret_size) + { + heap_free( bufptr ); + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + if (desc) + { + if (!s->size) desc->lpDescription = NULL; + else + { + desc->lpDescription = (WCHAR *)(desc + 1); + memcpy( desc->lpDescription, s->description, s->size ); + } + } + heap_free( bufptr ); + break; + } + case SERVICE_CONFIG_PRESHUTDOWN_INFO: + return set_error( err ); + + default: + break; + } + + return TRUE; +} + +/****************************************************************************** + * GetServiceDisplayNameW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetServiceDisplayNameW( SC_HANDLE manager, const WCHAR *service, + WCHAR *display_name, DWORD *len ) +{ + DWORD err; + DWORD size; + WCHAR buffer[2]; + + TRACE( "%p %s %p %p\n", manager, debugstr_w(service), display_name, len ); + + if (!manager) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + /* provide a buffer if the caller didn't */ + if (!display_name || *len < sizeof(WCHAR)) + { + display_name = buffer; + /* A size of 1 would be enough, but tests show that Windows returns 2, + * probably because of a WCHAR/bytes mismatch in their code. */ + *len = 2; + } + + /* RPC call takes size excluding nul-terminator, whereas *len + * includes the nul-terminator on input. */ + size = *len - 1; + + __TRY + { + err = svcctl_GetServiceDisplayNameW( manager, service, display_name, &size ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + /* The value of *len excludes nul-terminator on output. */ + if (err == ERROR_SUCCESS || err == ERROR_INSUFFICIENT_BUFFER) + *len = size; + return set_error( err ); +} + +/****************************************************************************** + * GetServiceKeyNameW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetServiceKeyNameW( SC_HANDLE manager, const WCHAR *display_name, + WCHAR *key_name, DWORD *len ) +{ + DWORD err; + WCHAR buffer[2]; + DWORD size; + + TRACE( "%p %s %p %p\n", manager, debugstr_w(display_name), key_name, len ); + + if (!manager) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + /* provide a buffer if the caller didn't */ + if (!key_name || *len < 2) + { + key_name = buffer; + /* A size of 1 would be enough, but tests show that Windows returns 2, + * probably because of a WCHAR/bytes mismatch in their code. + */ + *len = 2; + } + + /* RPC call takes size excluding nul-terminator, whereas *len + * includes the nul-terminator on input. */ + size = *len - 1; + + __TRY + { + err = svcctl_GetServiceKeyNameW( manager, display_name, key_name, &size ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + /* The value of *lpcchBuffer excludes nul-terminator on output. */ + if (err == ERROR_SUCCESS || err == ERROR_INSUFFICIENT_BUFFER) + *len = size; + return set_error( err ); +} + +/****************************************************************************** + * StartServiceA (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH StartServiceA( SC_HANDLE service, DWORD argc, const char **argv ) +{ + WCHAR **argvW = NULL; + DWORD i; + BOOL r; + + if (argc) + argvW = heap_alloc( argc * sizeof(WCHAR) ); + + for (i = 0; i < argc; i++) + argvW[i] = heap_strdupAtoW( argv[i] ); + + r = StartServiceW( service, argc, (const WCHAR **)argvW ); + + for (i = 0; i < argc; i++) + heap_free( argvW[i] ); + heap_free( argvW ); + return r; +} + + +/****************************************************************************** + * StartServiceW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH StartServiceW( SC_HANDLE service, DWORD argc, const WCHAR **argv ) +{ + DWORD err; + + TRACE( "%p %u %p\n", service, argc, argv ); + + __TRY + { + err = svcctl_StartServiceW( service, argc, argv ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * ControlService (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH ControlService( SC_HANDLE service, DWORD control, SERVICE_STATUS *status ) +{ + DWORD err; + + TRACE( "%p %d %p\n", service, control, status ); + + __TRY + { + err = svcctl_ControlService( service, control, status ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * QueryServiceStatus (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatus( SC_HANDLE service, SERVICE_STATUS *status ) +{ + SERVICE_STATUS_PROCESS process_status; + BOOL ret; + DWORD size; + + TRACE( "%p %p\n", service, status ); + + if (!service) return set_error( ERROR_INVALID_HANDLE ); + if (!status) return set_error( ERROR_INVALID_ADDRESS ); + + ret = QueryServiceStatusEx( service, SC_STATUS_PROCESS_INFO, (BYTE *)&process_status, + sizeof(SERVICE_STATUS_PROCESS), &size ); + if (ret) memcpy(status, &process_status, sizeof(SERVICE_STATUS) ); + return ret; +} + +/****************************************************************************** + * QueryServiceStatusEx (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatusEx( SC_HANDLE service, SC_STATUS_TYPE level, + BYTE *buffer, DWORD size, DWORD *ret_size ) +{ + DWORD err; + + TRACE( "%p %d %p %d %p\n", service, level, buffer, size, ret_size ); + + if (level != SC_STATUS_PROCESS_INFO) return set_error( ERROR_INVALID_LEVEL ); + + if (size < sizeof(SERVICE_STATUS_PROCESS)) + { + *ret_size = sizeof(SERVICE_STATUS_PROCESS); + return set_error( ERROR_INSUFFICIENT_BUFFER ); + } + + __TRY + { + err = svcctl_QueryServiceStatusEx( service, level, buffer, size, ret_size ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + return set_error( err ); +} + +/****************************************************************************** + * EnumServicesStatusExW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH EnumServicesStatusExW( SC_HANDLE manager, SC_ENUM_TYPE level, DWORD type, DWORD state, + BYTE *buffer, DWORD size, DWORD *needed, DWORD *returned, + DWORD *resume_handle, const WCHAR *group ) +{ + DWORD err, i, offset, buflen, count, total_size = 0; + ENUM_SERVICE_STATUS_PROCESSW *services = (ENUM_SERVICE_STATUS_PROCESSW *)buffer; + struct enum_service_status_process *entry; + const WCHAR *str; + BYTE *buf; + + TRACE( "%p %u 0x%x 0x%x %p %u %p %p %p %s\n", manager, level, type, state, buffer, + size, needed, returned, resume_handle, debugstr_w(group) ); + + if (level != SC_ENUM_PROCESS_INFO) return set_error( ERROR_INVALID_LEVEL ); + if (!manager) return set_error( ERROR_INVALID_HANDLE ); + if (!needed || !returned) return set_error( ERROR_INVALID_ADDRESS ); + + /* make sure we pass a valid pointer */ + buflen = max( size, sizeof(*services) ); + if (!(buf = heap_alloc( buflen ))) return set_error( ERROR_NOT_ENOUGH_MEMORY ); + + __TRY + { + err = svcctl_EnumServicesStatusExW( manager, SC_ENUM_PROCESS_INFO, type, state, buf, buflen, needed, + &count, resume_handle, group ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + *returned = 0; + if (err != ERROR_SUCCESS) + { + /* double the needed size to fit the potentially larger ENUM_SERVICE_STATUS_PROCESSW */ + if (err == ERROR_MORE_DATA) *needed *= 2; + heap_free( buf ); + SetLastError( err ); + return FALSE; + } + + entry = (struct enum_service_status_process *)buf; + for (i = 0; i < count; i++) + { + total_size += sizeof(*services); + if (entry->service_name) + { + str = (const WCHAR *)(buf + entry->service_name); + total_size += (wcslen( str ) + 1) * sizeof(WCHAR); + } + if (entry->display_name) + { + str = (const WCHAR *)(buf + entry->display_name); + total_size += (wcslen( str ) + 1) * sizeof(WCHAR); + } + entry++; + } + + if (total_size > size) + { + heap_free( buf ); + *needed = total_size; + SetLastError( ERROR_MORE_DATA ); + return FALSE; + } + + offset = count * sizeof(*services); + entry = (struct enum_service_status_process *)buf; + for (i = 0; i < count; i++) + { + DWORD str_size; + str = (const WCHAR *)(buf + entry->service_name); + str_size = (wcslen( str ) + 1) * sizeof(WCHAR); + services[i].lpServiceName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpServiceName, str, str_size ); + offset += str_size; + + if (!entry->display_name) services[i].lpDisplayName = NULL; + else + { + str = (const WCHAR *)(buf + entry->display_name); + str_size = (wcslen( str ) + 1) * sizeof(WCHAR); + services[i].lpDisplayName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpDisplayName, str, str_size ); + offset += str_size; + } + services[i].ServiceStatusProcess = entry->service_status_process; + entry++; + } + + heap_free( buf ); + *needed = 0; + *returned = count; + return TRUE; +} + +/****************************************************************************** + * EnumDependentServicesW (sechost.@) + */ +BOOL WINAPI EnumDependentServicesW( SC_HANDLE hService, DWORD dwServiceState, + LPENUM_SERVICE_STATUSW lpServices, DWORD cbBufSize, + LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned ) +{ + FIXME("%p 0x%08x %p 0x%08x %p %p - stub\n", hService, dwServiceState, + lpServices, cbBufSize, pcbBytesNeeded, lpServicesReturned); + + *lpServicesReturned = 0; + return TRUE; +} + +/****************************************************************************** + * QueryServiceObjectSecurity (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceObjectSecurity( SC_HANDLE service, SECURITY_INFORMATION type, + PSECURITY_DESCRIPTOR ret_descriptor, DWORD size, DWORD *ret_size ) +{ + SECURITY_DESCRIPTOR descriptor; + NTSTATUS status; + ACL acl; + + FIXME( "%p %d %p %u %p - semi-stub\n", service, type, ret_descriptor, size, ret_size ); + + if (type != DACL_SECURITY_INFORMATION) + FIXME("information %d not supported\n", type); + + InitializeSecurityDescriptor( &descriptor, SECURITY_DESCRIPTOR_REVISION ); + + InitializeAcl( &acl, sizeof(ACL), ACL_REVISION ); + SetSecurityDescriptorDacl( &descriptor, TRUE, &acl, TRUE ); + + status = RtlMakeSelfRelativeSD( &descriptor, ret_descriptor, &size ); + *ret_size = size; + + return set_error( RtlNtStatusToDosError( status ) ); +} + +/****************************************************************************** + * SetServiceObjectSecurity (sechost.@) + */ +BOOL WINAPI SetServiceObjectSecurity(SC_HANDLE hService, + SECURITY_INFORMATION dwSecurityInformation, + PSECURITY_DESCRIPTOR lpSecurityDescriptor) +{ + FIXME("%p %d %p\n", hService, dwSecurityInformation, lpSecurityDescriptor); + return TRUE; +} + +static DWORD WINAPI notify_thread(void *user) +{ + DWORD err; + struct notify_data *data = user; + SC_RPC_NOTIFY_PARAMS_LIST *list = NULL; + SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *cparams; + BOOL dummy; + + __TRY + { + /* GetNotifyResults blocks until there is an event */ + err = svcctl_GetNotifyResults(data->notify_handle, &list); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code(GetExceptionCode()); + } + __ENDTRY + + EnterCriticalSection( &service_cs ); + + list_remove(&data->entry); + + LeaveCriticalSection( &service_cs ); + + if (err == ERROR_SUCCESS && list) + { + cparams = list->NotifyParamsArray[0].params; + + data->notify_buffer->dwNotificationStatus = cparams->dwNotificationStatus; + memcpy(&data->notify_buffer->ServiceStatus, &cparams->ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS)); + data->notify_buffer->dwNotificationTriggered = cparams->dwNotificationTriggered; + data->notify_buffer->pszServiceNames = NULL; + + QueueUserAPC((PAPCFUNC)data->notify_buffer->pfnNotifyCallback, + data->calling_thread, (ULONG_PTR)data->notify_buffer); + + HeapFree(GetProcessHeap(), 0, list); + } + else + WARN("GetNotifyResults server call failed: %u\n", err); + + + __TRY + { + err = svcctl_CloseNotifyHandle(&data->notify_handle, &dummy); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code(GetExceptionCode()); + } + __ENDTRY + + if (err != ERROR_SUCCESS) + WARN("CloseNotifyHandle server call failed: %u\n", err); + + CloseHandle(data->calling_thread); + HeapFree(GetProcessHeap(), 0, data); + + return 0; +} + +/****************************************************************************** + * NotifyServiceStatusChangeW (sechost.@) + */ +DWORD WINAPI DECLSPEC_HOTPATCH NotifyServiceStatusChangeW( SC_HANDLE service, DWORD mask, + SERVICE_NOTIFYW *notify_buffer ) +{ + DWORD err; + BOOL b_dummy = FALSE; + GUID g_dummy = {0}; + struct notify_data *data; + + TRACE( "%p 0x%x %p\n", service, mask, notify_buffer ); + + if (!(data = heap_alloc_zero( sizeof(*data) ))) + return ERROR_NOT_ENOUGH_MEMORY; + + data->service = service; + data->notify_buffer = notify_buffer; + if (!DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), + &data->calling_thread, 0, FALSE, DUPLICATE_SAME_ACCESS )) + { + ERR("DuplicateHandle failed: %u\n", GetLastError()); + heap_free( data ); + return ERROR_NOT_ENOUGH_MEMORY; + } + + data->params.dwInfoLevel = 2; + data->params.params = &data->cparams; + + data->cparams.dwNotifyMask = mask; + + EnterCriticalSection( &service_cs ); + + __TRY + { + err = svcctl_NotifyServiceStatusChange( service, data->params, &g_dummy, + &g_dummy, &b_dummy, &data->notify_handle ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (err != ERROR_SUCCESS) + { + WARN("NotifyServiceStatusChange server call failed: %u\n", err); + LeaveCriticalSection( &service_cs ); + CloseHandle( data->calling_thread ); + CloseHandle( data->ready_evt ); + heap_free( data ); + return err; + } + + CloseHandle( CreateThread( NULL, 0, ¬ify_thread, data, 0, NULL ) ); + + list_add_tail( ¬ify_list, &data->entry ); + + LeaveCriticalSection( &service_cs ); + + return ERROR_SUCCESS; +} + +/* thunk for calling the RegisterServiceCtrlHandler handler function */ +static DWORD WINAPI ctrl_handler_thunk( DWORD control, DWORD type, void *data, void *context ) +{ + LPHANDLER_FUNCTION func = context; + + func( control ); + return ERROR_SUCCESS; +} + +/****************************************************************************** + * RegisterServiceCtrlHandlerA (sechost.@) + */ +SERVICE_STATUS_HANDLE WINAPI DECLSPEC_HOTPATCH RegisterServiceCtrlHandlerA( + const char *name, LPHANDLER_FUNCTION handler ) +{ + return RegisterServiceCtrlHandlerExA( name, ctrl_handler_thunk, handler ); +} + +/****************************************************************************** + * RegisterServiceCtrlHandlerW (sechost.@) + */ +SERVICE_STATUS_HANDLE WINAPI DECLSPEC_HOTPATCH RegisterServiceCtrlHandlerW( + const WCHAR *name, LPHANDLER_FUNCTION handler ) +{ + return RegisterServiceCtrlHandlerExW( name, ctrl_handler_thunk, handler ); +} + +/****************************************************************************** + * RegisterServiceCtrlHandlerExA (sechost.@) + */ +SERVICE_STATUS_HANDLE WINAPI DECLSPEC_HOTPATCH RegisterServiceCtrlHandlerExA( + const char *name, LPHANDLER_FUNCTION_EX handler, void *context ) +{ + WCHAR *nameW; + SERVICE_STATUS_HANDLE ret; + + nameW = heap_strdupAtoW( name ); + ret = RegisterServiceCtrlHandlerExW( nameW, handler, context ); + heap_free( nameW ); + return ret; +} + +static struct service_data *find_service_by_name( const WCHAR *name ) +{ + unsigned int i; + + if (nb_services == 1) /* only one service (FIXME: should depend on OWN_PROCESS etc.) */ + return services[0]; + for (i = 0; i < nb_services; i++) + if (!wcsicmp( name, services[i]->name )) return services[i]; + return NULL; +} + +/****************************************************************************** + * RegisterServiceCtrlHandlerExW (sechost.@) + */ +SERVICE_STATUS_HANDLE WINAPI DECLSPEC_HOTPATCH RegisterServiceCtrlHandlerExW( + const WCHAR *name, LPHANDLER_FUNCTION_EX handler, void *context ) +{ + struct service_data *service; + SC_HANDLE handle = 0; + + TRACE( "%s %p %p\n", debugstr_w(name), handler, context ); + + EnterCriticalSection( &service_cs ); + if ((service = find_service_by_name( name ))) + { + service->handler = handler; + service->context = context; + handle = service->handle; + } + LeaveCriticalSection( &service_cs ); + + if (!handle) SetLastError( ERROR_SERVICE_DOES_NOT_EXIST ); + return (SERVICE_STATUS_HANDLE)handle; +} + +/****************************************************************************** + * SetServiceStatus (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH SetServiceStatus( SERVICE_STATUS_HANDLE service, SERVICE_STATUS *status ) +{ + DWORD err; + + TRACE( "%p %#x %#x %#x %#x %#x %#x %#x\n", service, status->dwServiceType, + status->dwCurrentState, status->dwControlsAccepted, status->dwWin32ExitCode, + status->dwServiceSpecificExitCode, status->dwCheckPoint, status->dwWaitHint ); + + __TRY + { + err = svcctl_SetServiceStatus( service, status ); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (!set_error( err )) + return FALSE; + + if (status->dwCurrentState == SERVICE_STOPPED) + { + unsigned int i, count = 0; + EnterCriticalSection( &service_cs ); + for (i = 0; i < nb_services; i++) + { + if (services[i]->handle == (SC_HANDLE)service) continue; + if (services[i]->thread) count++; + } + if (!count) + { + stop_service = TRUE; + SetEvent( service_event ); /* notify the main loop */ + } + LeaveCriticalSection( &service_cs ); + } + + return TRUE; +} + +static WCHAR *service_get_pipe_name(void) +{ + static const WCHAR format[] = L"\\\\.\\pipe\\net\\NtControlPipe%u"; + WCHAR *name; + DWORD len; + HKEY service_current_key; + DWORD service_current; + LONG ret; + DWORD type; + + ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Control\\ServiceCurrent", + 0, KEY_QUERY_VALUE, &service_current_key ); + if (ret != ERROR_SUCCESS) + return NULL; + + len = sizeof(service_current); + ret = RegQueryValueExW( service_current_key, NULL, NULL, &type, + (BYTE *)&service_current, &len ); + RegCloseKey(service_current_key); + if (ret != ERROR_SUCCESS || type != REG_DWORD) + return NULL; + + len = ARRAY_SIZE(format) + 10 /* strlenW("4294967295") */; + name = heap_alloc(len * sizeof(WCHAR)); + if (!name) + return NULL; + + swprintf( name, len, format, service_current ); + return name; +} + +static HANDLE service_open_pipe(void) +{ + WCHAR *pipe_name = service_get_pipe_name(); + HANDLE handle = INVALID_HANDLE_VALUE; + + do + { + handle = CreateFileW( pipe_name, GENERIC_READ|GENERIC_WRITE, + 0, NULL, OPEN_ALWAYS, 0, NULL ); + if (handle != INVALID_HANDLE_VALUE) + break; + if (GetLastError() != ERROR_PIPE_BUSY) + break; + } while (WaitNamedPipeW( pipe_name, NMPWAIT_USE_DEFAULT_WAIT )); + heap_free(pipe_name); + + return handle; +} + +static DWORD WINAPI service_thread( void *arg ) +{ + struct service_data *info = arg; + WCHAR *str = info->args; + DWORD argc = 0, len = 0; + + TRACE("%p\n", arg); + + while (str[len]) + { + len += wcslen( &str[len] ) + 1; + argc++; + } + len++; + + if (info->unicode) + { + WCHAR **argv, *p; + + argv = heap_alloc( (argc+1)*sizeof(*argv) ); + for (argc = 0, p = str; *p; p += wcslen( p ) + 1) + argv[argc++] = p; + argv[argc] = NULL; + + info->proc.w( argc, argv ); + heap_free( argv ); + } + else + { + char *strA, **argv, *p; + DWORD lenA; + + lenA = WideCharToMultiByte( CP_ACP,0, str, len, NULL, 0, NULL, NULL ); + strA = heap_alloc(lenA); + WideCharToMultiByte(CP_ACP,0, str, len, strA, lenA, NULL, NULL); + + argv = heap_alloc( (argc+1)*sizeof(*argv) ); + for (argc = 0, p = strA; *p; p += strlen( p ) + 1) + argv[argc++] = p; + argv[argc] = NULL; + + info->proc.a( argc, argv ); + heap_free( argv ); + heap_free( strA ); + } + return 0; +} + +static DWORD service_handle_start( struct service_data *service, const void *data, DWORD data_size ) +{ + DWORD count = data_size / sizeof(WCHAR); + + if (service->thread) + { + WARN("service is not stopped\n"); + return ERROR_SERVICE_ALREADY_RUNNING; + } + + heap_free( service->args ); + service->args = heap_alloc( (count + 2) * sizeof(WCHAR) ); + if (count) memcpy( service->args, data, count * sizeof(WCHAR) ); + service->args[count++] = 0; + service->args[count++] = 0; + + service->thread = CreateThread( NULL, 0, service_thread, + service, 0, NULL ); + SetEvent( service_event ); /* notify the main loop */ + return 0; +} + +static DWORD service_handle_control( struct service_data *service, DWORD control, const void *data, DWORD data_size ) +{ + DWORD ret = ERROR_INVALID_SERVICE_CONTROL; + + TRACE( "%s control %u data %p data_size %u\n", debugstr_w(service->name), control, data, data_size ); + + if (control == SERVICE_CONTROL_START) + ret = service_handle_start( service, data, data_size ); + else if (service->handler) + ret = service->handler( control, 0, (void *)data, service->context ); + return ret; +} + +static DWORD WINAPI service_control_dispatcher( void *arg ) +{ + struct dispatcher_data *disp = arg; + + /* dispatcher loop */ + while (1) + { + struct service_data *service; + service_start_info info; + BYTE *data = NULL; + WCHAR *name; + BOOL r; + DWORD data_size = 0, count, result; + + r = ReadFile( disp->pipe, &info, FIELD_OFFSET(service_start_info,data), &count, NULL ); + if (!r) + { + if (GetLastError() != ERROR_BROKEN_PIPE) + ERR( "pipe read failed error %u\n", GetLastError() ); + break; + } + if (count != FIELD_OFFSET(service_start_info,data)) + { + ERR( "partial pipe read %u\n", count ); + break; + } + if (count < info.total_size) + { + data_size = info.total_size - FIELD_OFFSET(service_start_info,data); + data = heap_alloc( data_size ); + r = ReadFile( disp->pipe, data, data_size, &count, NULL ); + if (!r) + { + if (GetLastError() != ERROR_BROKEN_PIPE) + ERR( "pipe read failed error %u\n", GetLastError() ); + heap_free( data ); + break; + } + if (count != data_size) + { + ERR( "partial pipe read %u/%u\n", count, data_size ); + heap_free( data ); + break; + } + } + + EnterCriticalSection( &service_cs ); + + /* validate service name */ + name = (WCHAR *)data; + if (!info.name_size || data_size < info.name_size * sizeof(WCHAR) || name[info.name_size - 1]) + { + ERR( "got request without valid service name\n" ); + result = ERROR_INVALID_PARAMETER; + goto done; + } + + if (info.magic != SERVICE_PROTOCOL_MAGIC) + { + ERR( "received invalid request for service %s\n", debugstr_w(name) ); + result = ERROR_INVALID_PARAMETER; + goto done; + } + + /* find the service */ + if (!(service = find_service_by_name( name ))) + { + FIXME( "got request for unknown service %s\n", debugstr_w(name) ); + result = ERROR_INVALID_PARAMETER; + goto done; + } + + if (!service->handle) + { + if (!(service->handle = OpenServiceW( disp->manager, name, SERVICE_SET_STATUS )) || + !(service->full_access_handle = OpenServiceW( disp->manager, name, + GENERIC_READ|GENERIC_WRITE ))) + FIXME( "failed to open service %s\n", debugstr_w(name) ); + } + + data_size -= info.name_size * sizeof(WCHAR); + result = service_handle_control(service, info.control, data_size ? + &data[info.name_size * sizeof(WCHAR)] : NULL, data_size); + + done: + LeaveCriticalSection( &service_cs ); + WriteFile( disp->pipe, &result, sizeof(result), &count, NULL ); + heap_free( data ); + } + + CloseHandle( disp->pipe ); + CloseServiceHandle( disp->manager ); + heap_free( disp ); + return 1; +} + +/* wait for services which accept this type of message to become STOPPED */ +static void handle_shutdown_msg(DWORD msg, DWORD accept) +{ + SERVICE_STATUS st; + SERVICE_PRESHUTDOWN_INFO spi; + DWORD i, n = 0, sz, timeout = 2000; + ULONGLONG stop_time; + BOOL res, done = TRUE; + SC_HANDLE *wait_handles = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SC_HANDLE) * nb_services ); + + EnterCriticalSection( &service_cs ); + for (i = 0; i < nb_services; i++) + { + res = QueryServiceStatus( services[i]->full_access_handle, &st ); + if (!res || st.dwCurrentState == SERVICE_STOPPED || !(st.dwControlsAccepted & accept)) + continue; + + done = FALSE; + + if (accept == SERVICE_ACCEPT_PRESHUTDOWN) + { + res = QueryServiceConfig2W( services[i]->full_access_handle, SERVICE_CONFIG_PRESHUTDOWN_INFO, + (BYTE *)&spi, sizeof(spi), &sz ); + if (res) + { + FIXME( "service should be able to delay shutdown\n" ); + timeout = max( spi.dwPreshutdownTimeout, timeout ); + } + } + + service_handle_control( services[i], msg, NULL, 0 ); + wait_handles[n++] = services[i]->full_access_handle; + } + LeaveCriticalSection( &service_cs ); + + /* FIXME: these timeouts should be more generous, but we can't currently delay prefix shutdown */ + timeout = min( timeout, 3000 ); + stop_time = GetTickCount64() + timeout; + + while (!done && GetTickCount64() < stop_time) + { + done = TRUE; + for (i = 0; i < n; i++) + { + res = QueryServiceStatus( wait_handles[i], &st ); + if (!res || st.dwCurrentState == SERVICE_STOPPED) + continue; + + done = FALSE; + Sleep( 100 ); + break; + } + } + + HeapFree( GetProcessHeap(), 0, wait_handles ); +} + +static BOOL service_run_main_thread(void) +{ + DWORD i, n, ret; + HANDLE wait_handles[MAXIMUM_WAIT_OBJECTS]; + UINT wait_services[MAXIMUM_WAIT_OBJECTS]; + struct dispatcher_data *disp = heap_alloc( sizeof(*disp) ); + + disp->manager = OpenSCManagerW( NULL, NULL, SC_MANAGER_CONNECT ); + if (!disp->manager) + { + ERR("failed to open service manager error %u\n", GetLastError()); + heap_free( disp ); + return FALSE; + } + + disp->pipe = service_open_pipe(); + if (disp->pipe == INVALID_HANDLE_VALUE) + { + WARN("failed to create control pipe error %u\n", GetLastError()); + CloseServiceHandle( disp->manager ); + heap_free( disp ); + SetLastError( ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ); + return FALSE; + } + + service_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + stop_service = FALSE; + + /* FIXME: service_control_dispatcher should be merged into the main thread */ + NtSetInformationProcess( GetCurrentProcess(), ProcessWineMakeProcessSystem, + &wait_handles[0], sizeof(HANDLE *) ); + wait_handles[1] = CreateThread( NULL, 0, service_control_dispatcher, disp, 0, NULL ); + wait_handles[2] = service_event; + + TRACE("Starting %d services running as process %d\n", + nb_services, GetCurrentProcessId()); + + /* wait for all the threads to pack up and exit */ + while (!stop_service) + { + EnterCriticalSection( &service_cs ); + for (i = 0, n = 3; i < nb_services && n < MAXIMUM_WAIT_OBJECTS; i++) + { + if (!services[i]->thread) continue; + wait_services[n] = i; + wait_handles[n++] = services[i]->thread; + } + LeaveCriticalSection( &service_cs ); + + ret = WaitForMultipleObjects( n, wait_handles, FALSE, INFINITE ); + if (!ret) /* system process event */ + { + handle_shutdown_msg(SERVICE_CONTROL_PRESHUTDOWN, SERVICE_ACCEPT_PRESHUTDOWN); + handle_shutdown_msg(SERVICE_CONTROL_SHUTDOWN, SERVICE_ACCEPT_SHUTDOWN); + ExitProcess(0); + } + else if (ret == 1) + { + TRACE( "control dispatcher exited, shutting down\n" ); + /* FIXME: we should maybe send a shutdown control to running services */ + ExitProcess(0); + } + else if (ret == 2) + { + continue; /* rebuild the list */ + } + else if (ret < n) + { + i = wait_services[ret]; + EnterCriticalSection( &service_cs ); + CloseHandle( services[i]->thread ); + services[i]->thread = NULL; + LeaveCriticalSection( &service_cs ); + } + else return FALSE; + } + + return TRUE; +} + +/****************************************************************************** + * StartServiceCtrlDispatcherA (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH StartServiceCtrlDispatcherA( const SERVICE_TABLE_ENTRYA *servent ) +{ + struct service_data *info; + unsigned int i; + + TRACE("%p\n", servent); + + if (nb_services) + { + SetLastError( ERROR_SERVICE_ALREADY_RUNNING ); + return FALSE; + } + while (servent[nb_services].lpServiceName) nb_services++; + if (!nb_services) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + services = heap_alloc( nb_services * sizeof(*services) ); + + for (i = 0; i < nb_services; i++) + { + DWORD len = MultiByteToWideChar( CP_ACP, 0, servent[i].lpServiceName, -1, NULL, 0 ); + DWORD sz = FIELD_OFFSET( struct service_data, name[len] ); + info = heap_alloc_zero( sz ); + MultiByteToWideChar( CP_ACP, 0, servent[i].lpServiceName, -1, info->name, len ); + info->proc.a = servent[i].lpServiceProc; + info->unicode = FALSE; + services[i] = info; + } + + return service_run_main_thread(); +} + +/****************************************************************************** + * StartServiceCtrlDispatcherW (sechost.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH StartServiceCtrlDispatcherW( const SERVICE_TABLE_ENTRYW *servent ) +{ + struct service_data *info; + unsigned int i; + + TRACE("%p\n", servent); + + if (nb_services) + { + SetLastError( ERROR_SERVICE_ALREADY_RUNNING ); + return FALSE; + } + while (servent[nb_services].lpServiceName) nb_services++; + if (!nb_services) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + services = heap_alloc( nb_services * sizeof(*services) ); + + for (i = 0; i < nb_services; i++) + { + DWORD len = wcslen( servent[i].lpServiceName ) + 1; + DWORD sz = FIELD_OFFSET( struct service_data, name[len] ); + info = heap_alloc_zero( sz ); + wcscpy( info->name, servent[i].lpServiceName ); + info->proc.w = servent[i].lpServiceProc; + info->unicode = TRUE; + services[i] = info; + } + + return service_run_main_thread(); +} + +struct device_notification_details +{ + DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header); + HANDLE handle; +}; + +static HANDLE device_notify_thread; +static struct list device_notify_list = LIST_INIT(device_notify_list); + +struct device_notify_registration +{ + struct list entry; + struct device_notification_details details; +}; + +static DWORD WINAPI device_notify_proc( void *arg ) +{ + WCHAR endpoint[] = L"\\pipe\\wine_plugplay"; + WCHAR protseq[] = L"ncalrpc"; + RPC_WSTR binding_str; + DWORD err = ERROR_SUCCESS; + struct device_notify_registration *registration; + plugplay_rpc_handle handle = NULL; + DWORD code = 0; + unsigned int size; + BYTE *buf; + + if ((err = RpcStringBindingComposeW( NULL, protseq, NULL, endpoint, NULL, &binding_str ))) + { + ERR("RpcStringBindingCompose() failed, error %#x\n", err); + return err; + } + err = RpcBindingFromStringBindingW( binding_str, &plugplay_binding_handle ); + RpcStringFreeW( &binding_str ); + if (err) + { + ERR("RpcBindingFromStringBinding() failed, error %#x\n", err); + return err; + } + + __TRY + { + handle = plugplay_register_listener(); + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (!handle) + { + ERR("failed to open RPC handle, error %u\n", err); + return 1; + } + + for (;;) + { + buf = NULL; + __TRY + { + code = plugplay_get_event( handle, &buf, &size ); + err = ERROR_SUCCESS; + } + __EXCEPT(rpc_filter) + { + err = map_exception_code( GetExceptionCode() ); + } + __ENDTRY + + if (err) + { + ERR("failed to get event, error %u\n", err); + break; + } + + EnterCriticalSection( &service_cs ); + LIST_FOR_EACH_ENTRY(registration, &device_notify_list, struct device_notify_registration, entry) + { + registration->details.cb( registration->details.handle, code, (DEV_BROADCAST_HDR *)buf ); + } + LeaveCriticalSection(&service_cs); + MIDL_user_free(buf); + } + + __TRY + { + plugplay_unregister_listener( handle ); + } + __EXCEPT(rpc_filter) + { + } + __ENDTRY + + RpcBindingFree( &plugplay_binding_handle ); + return 0; +} + +/****************************************************************************** + * I_ScRegisterDeviceNotification (sechost.@) + */ +HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_details *details, + void *filter, DWORD flags ) +{ + struct device_notify_registration *registration; + + TRACE("callback %p, handle %p, filter %p, flags %#x\n", details->cb, details->handle, filter, flags); + + if (filter) FIXME("Notification filters are not yet implemented.\n"); + + if (!(registration = heap_alloc(sizeof(struct device_notify_registration)))) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + + registration->details = *details; + + EnterCriticalSection( &service_cs ); + list_add_tail( &device_notify_list, ®istration->entry ); + + if (!device_notify_thread) + device_notify_thread = CreateThread( NULL, 0, device_notify_proc, NULL, 0, NULL ); + + LeaveCriticalSection( &service_cs ); + + return registration; +} + +/****************************************************************************** + * I_ScUnregisterDeviceNotification (sechost.@) + */ +BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle ) +{ + struct device_notify_registration *registration = handle; + + TRACE("%p\n", handle); + + if (!handle) + return FALSE; + + EnterCriticalSection( &service_cs ); + list_remove( ®istration->entry ); + LeaveCriticalSection(&service_cs); + heap_free( registration ); + return TRUE; +} diff --git a/wrappers/new-dlls/sechost/svcctl.idl b/wrappers/new-dlls/sechost/svcctl.idl new file mode 100644 index 00000000000..b1bc8545d78 --- /dev/null +++ b/wrappers/new-dlls/sechost/svcctl.idl @@ -0,0 +1,3 @@ +#pragma makedep client + +#include "wine/svcctl.idl" diff --git a/wrappers/new-dlls/sechost/trace.c b/wrappers/new-dlls/sechost/trace.c new file mode 100644 index 00000000000..01733690ac8 --- /dev/null +++ b/wrappers/new-dlls/sechost/trace.c @@ -0,0 +1,155 @@ +/* + * Event tracing API + * + * Copyright 1995 Sven Verdoolaege + * Copyright 1998 Juergen Schmied + * Copyright 2003 Mike Hearn + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include "windef.h" +#include "winbase.h" +#include "wmistr.h" +#include "evntrace.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(eventlog); + +/****************************************************************************** + * ControlTraceA (sechost.@) + */ +ULONG WINAPI ControlTraceA( TRACEHANDLE handle, const char *session, + EVENT_TRACE_PROPERTIES *properties, ULONG control ) +{ + FIXME("(%s, %s, %p, %d) stub\n", wine_dbgstr_longlong(handle), debugstr_a(session), properties, control); + return ERROR_SUCCESS; +} + +/****************************************************************************** + * ControlTraceW (sechost.@) + */ +ULONG WINAPI ControlTraceW( TRACEHANDLE handle, const WCHAR *session, + EVENT_TRACE_PROPERTIES *properties, ULONG control ) +{ + FIXME("(%s, %s, %p, %d) stub\n", wine_dbgstr_longlong(handle), debugstr_w(session), properties, control); + return ERROR_SUCCESS; +} + +/****************************************************************************** + * EnableTraceEx2 (sechost.@) + */ +ULONG WINAPI EnableTraceEx2( TRACEHANDLE handle, const GUID *provider, ULONG control, UCHAR level, + ULONGLONG match_any, ULONGLONG match_all, ULONG timeout, + ENABLE_TRACE_PARAMETERS *params ) +{ + FIXME("(%s, %s, %u, %u, %s, %s, %u, %p): stub\n", wine_dbgstr_longlong(handle), + debugstr_guid(provider), control, level, wine_dbgstr_longlong(match_any), + wine_dbgstr_longlong(match_all), timeout, params); + + return ERROR_SUCCESS; +} + +/****************************************************************************** + * QueryAllTracesA (sechost.@) + */ +ULONG WINAPI QueryAllTracesA( EVENT_TRACE_PROPERTIES **properties, ULONG count, ULONG *ret_count ) +{ + FIXME("(%p, %d, %p) stub\n", properties, count, ret_count); + + if (ret_count) *ret_count = 0; + return ERROR_SUCCESS; +} + +/****************************************************************************** + * QueryAllTracesW (sechost.@) + */ +ULONG WINAPI QueryAllTracesW( EVENT_TRACE_PROPERTIES **properties, ULONG count, ULONG *ret_count ) +{ + FIXME("(%p, %d, %p) stub\n", properties, count, ret_count); + + if (ret_count) *ret_count = 0; + return ERROR_SUCCESS; +} + +/****************************************************************************** + * StartTraceA (sechost.@) + */ +ULONG WINAPI StartTraceA( TRACEHANDLE *handle, const char *session, EVENT_TRACE_PROPERTIES *properties ) +{ + FIXME("(%p, %s, %p) stub\n", handle, debugstr_a(session), properties); + if (handle) *handle = 0xcafe4242; + return ERROR_SUCCESS; +} + +/****************************************************************************** + * StartTraceW (sechost.@) + */ +ULONG WINAPI StartTraceW( TRACEHANDLE *handle, const WCHAR *session, EVENT_TRACE_PROPERTIES *properties ) +{ + FIXME("(%p, %s, %p) stub\n", handle, debugstr_w(session), properties); + if (handle) *handle = 0xcafe4242; + return ERROR_SUCCESS; +} + +/****************************************************************************** + * StopTraceW (sechost.@) + */ +ULONG WINAPI StopTraceW( TRACEHANDLE handle, const WCHAR *session, EVENT_TRACE_PROPERTIES *properties ) +{ + FIXME("(%s, %s, %p) stub\n", wine_dbgstr_longlong(handle), debugstr_w(session), properties); + return ERROR_SUCCESS; +} + +/****************************************************************************** + * OpenTraceW (sechost.@) + */ +TRACEHANDLE WINAPI OpenTraceW( EVENT_TRACE_LOGFILEW *logfile ) +{ + static int once; + + if (!once++) FIXME("%p: stub\n", logfile); + SetLastError(ERROR_ACCESS_DENIED); + return INVALID_PROCESSTRACE_HANDLE; +} + +/****************************************************************************** + * ProcessTrace (sechost.@) + */ +ULONG WINAPI ProcessTrace( TRACEHANDLE *handles, ULONG count, FILETIME *start_time, FILETIME *end_time ) +{ + FIXME("%p %u %p %p: stub\n", handles, count, start_time, end_time); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/****************************************************************************** + * CloseTrace (sechost.@) + */ +ULONG WINAPI CloseTrace( TRACEHANDLE handle ) +{ + FIXME("%s: stub\n", wine_dbgstr_longlong(handle)); + return ERROR_INVALID_HANDLE; +} + +/****************************************************************************** + * TraceSetInformation (sechost.@) + */ +ULONG WINAPI TraceSetInformation( TRACEHANDLE handle, TRACE_INFO_CLASS class, void *info, ULONG len ) +{ + FIXME("%s %d %p %d: stub\n", wine_dbgstr_longlong(handle), class, info, len); + return ERROR_CALL_NOT_IMPLEMENTED; +} diff --git a/wrappers/new-dlls/sppc/Makefile.in b/wrappers/new-dlls/sppc/Makefile.in new file mode 100644 index 00000000000..60f06e0c4c8 --- /dev/null +++ b/wrappers/new-dlls/sppc/Makefile.in @@ -0,0 +1,6 @@ +MODULE = sppc.dll + +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native + +C_SRCS = \ + sppc.c diff --git a/wrappers/new-dlls/sppc/sppc.c b/wrappers/new-dlls/sppc/sppc.c new file mode 100644 index 00000000000..cd78611558d --- /dev/null +++ b/wrappers/new-dlls/sppc/sppc.c @@ -0,0 +1,52 @@ +/* + * + * Copyright 2008 Alistair Leslie-Hughes + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "wine/debug.h" + +#include "slpublic.h" +#include "slerror.h" + +WINE_DEFAULT_DEBUG_CHANNEL(slc); + +HRESULT WINAPI SLGetLicensingStatusInformation(HSLC handle, const SLID *app, const SLID *product, + LPCWSTR name, UINT *count, SL_LICENSING_STATUS **status) +{ + FIXME("(%p %p %p %s %p %p) stub\n", handle, app, product, debugstr_w(name), count, status ); + + return SL_E_RIGHT_NOT_CONSUMED; +} + +HRESULT WINAPI SLOpen(HSLC *handle) +{ + FIXME("(%p) stub\n", handle ); + + if (!handle) + return E_INVALIDARG; + + *handle = (HSLC)0xdeadbeef; + + return S_OK; +} diff --git a/wrappers/new-dlls/sppc/sppc.spec b/wrappers/new-dlls/sppc/sppc.spec new file mode 100644 index 00000000000..af93e5619db --- /dev/null +++ b/wrappers/new-dlls/sppc/sppc.spec @@ -0,0 +1,67 @@ +@ stub SLCallServer +@ stub SLpAuthenticateGenuineTicketResponse +@ stub SLpBeginGenuineTicketTransaction +@ stub SLpClearActivationInProgress +@ stub SLpDepositDownlevelGenuineTicket +@ stub SLpDepositTokenActivationResponse +@ stub SLpGenerateTokenActivationChallenge +@ stub SLpGetGenuineBlob +@ stub SLpGetGenuineLocal +@ stub SLpGetLicenseAcquisitionInfo +@ stub SLpGetMSPidInformation +@ stub SLpGetMachineUGUID +@ stub SLpGetTokenActivationGrantInfo +@ stub SLpIAActivateProduct +@ stub SLpIsCurrentInstalledProductKeyDefaultKey +@ stub SLpProcessVMPipeMessage +@ stub SLpSetActivationInProgress +@ stub SLpTriggerServiceWorker +@ stub SLpVLActivateProduct +@ stub SLClose +@ stub SLConsumeRight +@ stub SLDepositMigrationBlob +@ stub SLDepositOfflineConfirmationId +@ stub SLDepositOfflineConfirmationIdEx +@ stub SLDepositStoreToken +@ stub SLFireEvent +@ stub SLGatherMigrationBlob +@ stub SLGatherMigrationBlobEx +@ stub SLGenerateOfflineInstallationId +@ stub SLGenerateOfflineInstallationIdEx +@ stub SLGetActiveLicenseInfo +@ stub SLGetApplicationInformation +@ stub SLGetApplicationPolicy +@ stub SLGetAuthenticationResult +@ stub SLGetEncryptedPIDEx +@ stub SLGetGenuineInformation +@ stub SLGetInstalledProductKeyIds +@ stub SLGetLicense +@ stub SLGetLicenseFileId +@ stub SLGetLicenseInformation +@ stdcall SLGetLicensingStatusInformation(ptr ptr ptr wstr ptr ptr) +@ stub SLGetPKeyId +@ stub SLGetPKeyInformation +@ stub SLGetPolicyInformation +@ stub SLGetPolicyInformationDWORD +@ stub SLGetProductSkuInformation +@ stub SLGetSLIDList +@ stub SLGetServiceInformation +@ stub SLInstallLicense +@ stub SLInstallProofOfPurchase +@ stub SLInstallProofOfPurchaseEx +@ stub SLIsGenuineLocalEx +@ stub SLLoadApplicationPolicies +@ stdcall SLOpen(ptr) +@ stub SLPersistApplicationPolicies +@ stub SLPersistRTSPayloadOverride +@ stub SLReArm +@ stub SLRegisterEvent +@ stub SLRegisterPlugin +@ stub SLSetAuthenticationData +@ stub SLSetCurrentProductKey +@ stub SLSetGenuineInformation +@ stub SLUninstallLicense +@ stub SLUninstallProofOfPurchase +@ stub SLUnloadApplicationPolicies +@ stub SLUnregisterEvent +@ stub SLUnregisterPlugin diff --git a/wrappers/new-dlls/srvcli/Makefile.in b/wrappers/new-dlls/srvcli/Makefile.in new file mode 100644 index 00000000000..716cc1b3867 --- /dev/null +++ b/wrappers/new-dlls/srvcli/Makefile.in @@ -0,0 +1,5 @@ +MODULE = srvcli.dll + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = main.c diff --git a/wrappers/new-dlls/srvcli/main.c b/wrappers/new-dlls/srvcli/main.c new file mode 100644 index 00000000000..0df8e00d0fa --- /dev/null +++ b/wrappers/new-dlls/srvcli/main.c @@ -0,0 +1,41 @@ +/* + * + * Copyright (C) 2020 Alistair Leslie-Hughes + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(srvcli); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff --git a/wrappers/new-dlls/srvcli/srvcli.spec b/wrappers/new-dlls/srvcli/srvcli.spec new file mode 100644 index 00000000000..821724a7d4d --- /dev/null +++ b/wrappers/new-dlls/srvcli/srvcli.spec @@ -0,0 +1,61 @@ +@ stub I_NetDfsGetVersion +@ stub I_NetServerSetServiceBits +@ stub I_NetServerSetServiceBitsEx +@ stub LocalAliasGet +@ stub LocalFileClose +@ stub LocalFileEnum +@ stub LocalFileEnumEx +@ stub LocalFileGetInfo +@ stub LocalFileGetInfoEx +@ stub LocalServerCertificateMappingAdd +@ stub LocalServerCertificateMappingEnum +@ stub LocalServerCertificateMappingGet +@ stub LocalServerCertificateMappingRemove +@ stub LocalSessionDel +@ stub LocalSessionEnum +@ stub LocalSessionEnumEx +@ stub LocalSessionGetInfo +@ stub LocalSessionGetInfoEx +@ stub LocalShareAdd +@ stub LocalShareDelEx +@ stub LocalShareEnum +@ stub LocalShareEnumEx +@ stub LocalShareGetInfo +@ stub LocalShareGetInfoEx +@ stub LocalShareSetInfo +@ stub NetConnectionEnum +@ stub NetFileClose +@ stdcall NetFileEnum(wstr wstr wstr long ptr long ptr ptr ptr) netapi32.NetFileEnum +@ stub NetFileGetInfo +@ stub NetRemoteTOD +@ stub NetServerAliasAdd +@ stub NetServerAliasDel +@ stub NetServerAliasEnum +@ stub NetServerComputerNameAdd +@ stub NetServerComputerNameDel +@ stdcall NetServerDiskEnum(wstr long ptr long ptr ptr ptr) netapi32.NetServerDiskEnum +@ stdcall NetServerGetInfo(wstr long ptr) netapi32.NetServerGetInfo +@ stub NetServerSetInfo +@ stub NetServerStatisticsGet +@ stub NetServerTransportAdd +@ stub NetServerTransportAddEx +@ stub NetServerTransportDel +@ stub NetServerTransportEnum +@ stub NetSessionDel +@ stdcall NetSessionEnum(wstr wstr wstr long ptr long ptr ptr ptr) netapi32.NetSessionEnum +@ stub NetSessionGetInfo +@ stdcall NetShareAdd(wstr long ptr ptr) netapi32.NetShareAdd +@ stub NetShareCheck +@ stdcall NetShareDel(wstr wstr long) netapi32.NetShareDel +@ stub NetShareDelEx +@ stub NetShareDelSticky +@ stdcall NetShareEnum(wstr long ptr long ptr ptr ptr) netapi32.NetShareEnum +@ stub NetShareEnumSticky +@ stdcall NetShareGetInfo(wstr wstr long ptr) netapi32.NetShareGetInfo +@ stub NetShareSetInfo +@ stub NetpsNameCanonicalize +@ stub NetpsNameCompare +@ stub NetpsNameValidate +@ stub NetpsPathCanonicalize +@ stub NetpsPathCompare +@ stub NetpsPathType diff --git a/wrappers/new-dlls/strmbase/Makefile.in b/wrappers/new-dlls/strmbase/Makefile.in new file mode 100644 index 00000000000..ec13acccf40 --- /dev/null +++ b/wrappers/new-dlls/strmbase/Makefile.in @@ -0,0 +1,12 @@ +MODULE = libstrmbase.a + +C_SRCS = \ + dispatch.c \ + filter.c \ + mediatype.c \ + outputqueue.c \ + pin.c \ + pospass.c \ + qualitycontrol.c \ + renderer.c \ + seeking.c diff --git a/wrappers/new-dlls/strmbase/dispatch.c b/wrappers/new-dlls/strmbase/dispatch.c new file mode 100644 index 00000000000..de817f20c0d --- /dev/null +++ b/wrappers/new-dlls/strmbase/dispatch.c @@ -0,0 +1,83 @@ +/* + * ITypeInfo cache for IDispatch + * + * Copyright 2019 Zebediah Figura + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static ITypeLib *control_typelib; +static ITypeInfo *control_typeinfo[last_tid]; + +static REFIID control_tid_id[] = +{ + &IID_IBasicAudio, + &IID_IBasicVideo, + &IID_IMediaControl, + &IID_IMediaEvent, + &IID_IMediaPosition, + &IID_IVideoWindow, +}; + +HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **ret) +{ + HRESULT hr; + + if (!control_typelib) + { + ITypeLib *typelib; + + hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &typelib); + if (FAILED(hr)) + { + ERR("Failed to load typelib, hr %#x.\n", hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)&control_typelib, typelib, NULL)) + ITypeLib_Release(typelib); + } + if (!control_typeinfo[tid]) + { + ITypeInfo *typeinfo; + + hr = ITypeLib_GetTypeInfoOfGuid(control_typelib, control_tid_id[tid], &typeinfo); + if (FAILED(hr)) + { + ERR("Failed to get type info for %s, hr %#x.\n", debugstr_guid(control_tid_id[tid]), hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)(control_typeinfo + tid), typeinfo, NULL)) + ITypeInfo_Release(typeinfo); + } + ITypeInfo_AddRef(*ret = control_typeinfo[tid]); + return S_OK; +} + +void strmbase_release_typelibs(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(control_typeinfo); ++i) + { + if (control_typeinfo[i]) + ITypeInfo_Release(control_typeinfo[i]); + } + if (control_typelib) + ITypeLib_Release(control_typelib); +} diff --git a/wrappers/new-dlls/strmbase/filter.c b/wrappers/new-dlls/strmbase/filter.c new file mode 100644 index 00000000000..93593e4c189 --- /dev/null +++ b/wrappers/new-dlls/strmbase/filter.c @@ -0,0 +1,550 @@ +/* + * Generic Implementation of IBaseFilter Interface + * + * Copyright 2010 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +struct enum_pins +{ + IEnumPins IEnumPins_iface; + LONG refcount; + + unsigned int index, count; + int version; + struct strmbase_filter *filter; +}; + +static const IEnumPinsVtbl enum_pins_vtbl; + +static HRESULT enum_pins_create(struct strmbase_filter *filter, IEnumPins **out) +{ + struct enum_pins *object; + + if (!out) + return E_POINTER; + + if (!(object = heap_alloc_zero(sizeof(*object)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + object->IEnumPins_iface.lpVtbl = &enum_pins_vtbl; + object->refcount = 1; + object->filter = filter; + IBaseFilter_AddRef(&filter->IBaseFilter_iface); + object->version = filter->pin_version; + + while (filter->ops->filter_get_pin(filter, object->count)) + ++object->count; + + TRACE("Created enumerator %p.\n", object); + *out = &object->IEnumPins_iface; + + return S_OK; +} + +static inline struct enum_pins *impl_from_IEnumPins(IEnumPins *iface) +{ + return CONTAINING_RECORD(iface, struct enum_pins, IEnumPins_iface); +} + +static HRESULT WINAPI enum_pins_QueryInterface(IEnumPins *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IEnumPins)) + { + IEnumPins_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI enum_pins_AddRef(IEnumPins *iface) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + ULONG refcount = InterlockedIncrement(&enum_pins->refcount); + TRACE("%p increasing refcount to %u.\n", enum_pins, refcount); + return refcount; +} + +static ULONG WINAPI enum_pins_Release(IEnumPins *iface) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + ULONG refcount = InterlockedDecrement(&enum_pins->refcount); + + TRACE("%p decreasing refcount to %u.\n", enum_pins, refcount); + if (!refcount) + { + IBaseFilter_Release(&enum_pins->filter->IBaseFilter_iface); + heap_free(enum_pins); + } + return refcount; +} + +static HRESULT WINAPI enum_pins_Next(IEnumPins *iface, ULONG count, IPin **pins, ULONG *ret_count) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + unsigned int i; + + TRACE("iface %p, count %u, pins %p, ret_count %p.\n", iface, count, pins, ret_count); + + if (!pins) + return E_POINTER; + + if (count > 1 && !ret_count) + return E_INVALIDARG; + + if (ret_count) + *ret_count = 0; + + if (enum_pins->version != enum_pins->filter->pin_version) + return S_FALSE; + + for (i = 0; i < count; ++i) + { + struct strmbase_pin *pin = enum_pins->filter->ops->filter_get_pin(enum_pins->filter, enum_pins->index + i); + + if (!pin) + break; + + IPin_AddRef(pins[i] = &pin->IPin_iface); + } + + if (ret_count) + *ret_count = i; + enum_pins->index += i; + return i == count ? S_OK : S_FALSE; +} + +static HRESULT WINAPI enum_pins_Skip(IEnumPins *iface, ULONG count) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + + TRACE("iface %p, count %u.\n", iface, count); + + if (enum_pins->version != enum_pins->filter->pin_version) + return VFW_E_ENUM_OUT_OF_SYNC; + + if (enum_pins->index + count > enum_pins->count) + return S_FALSE; + + enum_pins->index += count; + return S_OK; +} + +static HRESULT WINAPI enum_pins_Reset(IEnumPins *iface) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + + TRACE("iface %p.\n", iface); + + if (enum_pins->version != enum_pins->filter->pin_version) + { + enum_pins->count = 0; + while (enum_pins->filter->ops->filter_get_pin(enum_pins->filter, enum_pins->count)) + ++enum_pins->count; + } + + enum_pins->version = enum_pins->filter->pin_version; + enum_pins->index = 0; + + return S_OK; +} + +static HRESULT WINAPI enum_pins_Clone(IEnumPins *iface, IEnumPins **out) +{ + struct enum_pins *enum_pins = impl_from_IEnumPins(iface); + HRESULT hr; + + TRACE("iface %p, out %p.\n", iface, out); + + if (FAILED(hr = enum_pins_create(enum_pins->filter, out))) + return hr; + return IEnumPins_Skip(*out, enum_pins->index); +} + +static const IEnumPinsVtbl enum_pins_vtbl = +{ + enum_pins_QueryInterface, + enum_pins_AddRef, + enum_pins_Release, + enum_pins_Next, + enum_pins_Skip, + enum_pins_Reset, + enum_pins_Clone, +}; + +static inline struct strmbase_filter *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_filter, IUnknown_inner); +} + +static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, void **out) +{ + struct strmbase_filter *filter = impl_from_IUnknown(iface); + HRESULT hr; + + TRACE("filter %p %s, iid %s, out %p.\n", filter, debugstr_w(filter->name), debugstr_guid(iid), out); + + *out = NULL; + + if (filter->ops->filter_query_interface + && SUCCEEDED(hr = filter->ops->filter_query_interface(filter, iid, out))) + { + return hr; + } + + if (IsEqualIID(iid, &IID_IUnknown)) + *out = iface; + else if (IsEqualIID(iid, &IID_IPersist) + || IsEqualIID(iid, &IID_IMediaFilter) + || IsEqualIID(iid, &IID_IBaseFilter)) + { + *out = &filter->IBaseFilter_iface; + } + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI filter_inner_AddRef(IUnknown *iface) +{ + struct strmbase_filter *filter = impl_from_IUnknown(iface); + ULONG refcount = InterlockedIncrement(&filter->refcount); + + TRACE("%p increasing refcount to %u.\n", filter, refcount); + + return refcount; +} + +static ULONG WINAPI filter_inner_Release(IUnknown *iface) +{ + struct strmbase_filter *filter = impl_from_IUnknown(iface); + ULONG refcount = InterlockedDecrement(&filter->refcount); + + TRACE("%p decreasing refcount to %u.\n", filter, refcount); + + if (!refcount) + filter->ops->filter_destroy(filter); + + return refcount; +} + +static const IUnknownVtbl filter_inner_vtbl = +{ + filter_inner_QueryInterface, + filter_inner_AddRef, + filter_inner_Release, +}; + +static inline struct strmbase_filter *impl_from_IBaseFilter(IBaseFilter *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); +} + +static HRESULT WINAPI filter_QueryInterface(IBaseFilter *iface, REFIID iid, void **out) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + return IUnknown_QueryInterface(filter->outer_unk, iid, out); +} + +static ULONG WINAPI filter_AddRef(IBaseFilter *iface) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + return IUnknown_AddRef(filter->outer_unk); +} + +static ULONG WINAPI filter_Release(IBaseFilter *iface) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + return IUnknown_Release(filter->outer_unk); +} + +static HRESULT WINAPI filter_GetClassID(IBaseFilter *iface, CLSID *clsid) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, clsid %p.\n", filter, debugstr_w(filter->name), clsid); + + *clsid = filter->clsid; + + return S_OK; +} + +static HRESULT WINAPI filter_Stop(IBaseFilter *iface) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK; + + TRACE("filter %p %s.\n", filter, debugstr_w(filter->name)); + + EnterCriticalSection(&filter->filter_cs); + + if (filter->state == State_Running && filter->ops->filter_stop_stream) + hr = filter->ops->filter_stop_stream(filter); + if (SUCCEEDED(hr) && filter->ops->filter_cleanup_stream) + hr = filter->ops->filter_cleanup_stream(filter); + if (SUCCEEDED(hr)) + filter->state = State_Stopped; + + LeaveCriticalSection(&filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI filter_Pause(IBaseFilter *iface) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK; + + TRACE("filter %p %s.\n", filter, debugstr_w(filter->name)); + + EnterCriticalSection(&filter->filter_cs); + + if (filter->state == State_Stopped && filter->ops->filter_init_stream) + hr = filter->ops->filter_init_stream(filter); + else if (filter->state == State_Running && filter->ops->filter_stop_stream) + hr = filter->ops->filter_stop_stream(filter); + if (SUCCEEDED(hr)) + filter->state = State_Paused; + + LeaveCriticalSection(&filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI filter_Run(IBaseFilter *iface, REFERENCE_TIME start) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK; + + TRACE("filter %p %s, start %s.\n", filter, debugstr_w(filter->name), debugstr_time(start)); + + EnterCriticalSection(&filter->filter_cs); + + if (filter->state == State_Stopped && filter->ops->filter_init_stream) + hr = filter->ops->filter_init_stream(filter); + if (SUCCEEDED(hr) && filter->ops->filter_start_stream) + hr = filter->ops->filter_start_stream(filter, start); + if (SUCCEEDED(hr)) + filter->state = State_Running; + + LeaveCriticalSection(&filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI filter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK; + + TRACE("filter %p %s, timeout %u, state %p.\n", filter, debugstr_w(filter->name), timeout, state); + + EnterCriticalSection(&filter->filter_cs); + + if (filter->ops->filter_wait_state) + hr = filter->ops->filter_wait_state(filter, timeout); + *state = filter->state; + + LeaveCriticalSection(&filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI filter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, clock %p.\n", filter, debugstr_w(filter->name), clock); + + EnterCriticalSection(&filter->filter_cs); + + if (filter->clock) + IReferenceClock_Release(filter->clock); + filter->clock = clock; + if (filter->clock) + IReferenceClock_AddRef(filter->clock); + + LeaveCriticalSection(&filter->filter_cs); + + return S_OK; +} + +static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **clock) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, clock %p.\n", filter, debugstr_w(filter->name), clock); + + EnterCriticalSection(&filter->filter_cs); + + *clock = filter->clock; + if (filter->clock) + IReferenceClock_AddRef(filter->clock); + + LeaveCriticalSection(&filter->filter_cs); + + return S_OK; +} + +static HRESULT WINAPI filter_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, enum_pins %p.\n", filter, debugstr_w(filter->name), enum_pins); + + return enum_pins_create(filter, enum_pins); +} + +static HRESULT WINAPI filter_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + struct strmbase_pin *pin; + unsigned int i; + + TRACE("filter %p %s, id %s, ret %p.\n", filter, debugstr_w(filter->name), debugstr_w(id), ret); + + for (i = 0; (pin = filter->ops->filter_get_pin(filter, i)); ++i) + { + if (!lstrcmpW(id, pin->name)) + { + IPin_AddRef(*ret = &pin->IPin_iface); + return S_OK; + } + } + + return VFW_E_NOT_FOUND; +} + +static HRESULT WINAPI filter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *info) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, info %p.\n", filter, debugstr_w(filter->name), info); + + lstrcpyW(info->achName, filter->name); + info->pGraph = filter->graph; + + if (info->pGraph) + IFilterGraph_AddRef(info->pGraph); + + return S_OK; +} + +static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *graph, const WCHAR *name) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, graph %p, name %s.\n", filter, debugstr_w(filter->name), graph, debugstr_w(name)); + + EnterCriticalSection(&filter->filter_cs); + + if (name) + lstrcpynW(filter->name, name, ARRAY_SIZE(filter->name)); + else + filter->name[0] = 0; + /* The graph references us, so we cannot also reference the graph. */ + filter->graph = graph; + + LeaveCriticalSection(&filter->filter_cs); + + return S_OK; +} + +static HRESULT WINAPI filter_QueryVendorInfo(IBaseFilter *iface, WCHAR **info) +{ + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + + TRACE("filter %p %s, info %p.\n", filter, debugstr_w(filter->name), info); + + return E_NOTIMPL; +} + +static const IBaseFilterVtbl filter_vtbl = +{ + filter_QueryInterface, + filter_AddRef, + filter_Release, + filter_GetClassID, + filter_Stop, + filter_Pause, + filter_Run, + filter_GetState, + filter_SetSyncSource, + filter_GetSyncSource, + filter_EnumPins, + filter_FindPin, + filter_QueryFilterInfo, + filter_JoinFilterGraph, + filter_QueryVendorInfo, +}; + +VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) +{ + InterlockedIncrement(&filter->pin_version); +} + +void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, + const CLSID *clsid, const struct strmbase_filter_ops *ops) +{ + memset(filter, 0, sizeof(*filter)); + + filter->IBaseFilter_iface.lpVtbl = &filter_vtbl; + filter->IUnknown_inner.lpVtbl = &filter_inner_vtbl; + filter->outer_unk = outer ? outer : &filter->IUnknown_inner; + filter->refcount = 1; + + InitializeCriticalSection(&filter->filter_cs); + if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->filter_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.filter_cs"); + InitializeCriticalSection(&filter->stream_cs); + if (filter->stream_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->stream_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.stream_cs"); + filter->clsid = *clsid; + filter->pin_version = 1; + filter->ops = ops; +} + +void strmbase_filter_cleanup(struct strmbase_filter *filter) +{ + if (filter->clock) + IReferenceClock_Release(filter->clock); + + filter->IBaseFilter_iface.lpVtbl = NULL; + if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->filter_cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&filter->filter_cs); + if (filter->stream_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->stream_cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&filter->stream_cs); +} diff --git a/wrappers/new-dlls/strmbase/mediatype.c b/wrappers/new-dlls/strmbase/mediatype.c new file mode 100644 index 00000000000..9544d1b8bae --- /dev/null +++ b/wrappers/new-dlls/strmbase/mediatype.c @@ -0,0 +1,205 @@ +/* + * Implementation of MedaType utility functions + * + * Copyright 2003 Robert Shearman + * Copyright 2010 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" +#include "dvdmedia.h" +#include "dxva.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static const struct +{ + const GUID *guid; + const char *name; +} +strmbase_guids[] = +{ +#define X(g) {&(g), #g} + X(GUID_NULL), + +#undef OUR_GUID_ENTRY +#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) X(name), +#include "uuids.h" + +#undef X +}; + +static const char *strmbase_debugstr_guid(const GUID *guid) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(strmbase_guids); ++i) + { + if (IsEqualGUID(strmbase_guids[i].guid, guid)) + return wine_dbg_sprintf("%s", strmbase_guids[i].name); + } + + return debugstr_guid(guid); +} + +static const char *debugstr_fourcc(DWORD fourcc) +{ + char str[4] = {fourcc, fourcc >> 8, fourcc >> 16, fourcc >> 24}; + if (isprint(str[0]) && isprint(str[1]) && isprint(str[2]) && isprint(str[3])) + return wine_dbgstr_an(str, 4); + return wine_dbg_sprintf("%#x", fourcc); +} + +void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt) +{ + if (!TRACE_ON(strmbase) || !mt) return; + + TRACE("Dumping media type %p: major type %s, subtype %s", + mt, strmbase_debugstr_guid(&mt->majortype), strmbase_debugstr_guid(&mt->subtype)); + if (mt->bFixedSizeSamples) TRACE(", fixed size samples"); + if (mt->bTemporalCompression) TRACE(", temporal compression"); + if (mt->lSampleSize) TRACE(", sample size %d", mt->lSampleSize); + if (mt->pUnk) TRACE(", pUnk %p", mt->pUnk); + TRACE(", format type %s.\n", strmbase_debugstr_guid(&mt->formattype)); + + if (!mt->pbFormat) return; + + TRACE("Dumping format %p: ", mt->pbFormat); + + if (IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx) && mt->cbFormat >= sizeof(WAVEFORMATEX)) + { + WAVEFORMATEX *wfx = (WAVEFORMATEX *)mt->pbFormat; + + TRACE("tag %#x, %u channels, sample rate %u, %u bytes/sec, alignment %u, %u bits/sample.\n", + wfx->wFormatTag, wfx->nChannels, wfx->nSamplesPerSec, + wfx->nAvgBytesPerSec, wfx->nBlockAlign, wfx->wBitsPerSample); + + if (wfx->cbSize) + { + const unsigned char *extra = (const unsigned char *)(wfx + 1); + unsigned int i; + + TRACE(" Extra bytes:"); + for (i = 0; i < wfx->cbSize; ++i) + { + if (!(i % 16)) TRACE("\n "); + TRACE(" %02x", extra[i]); + } + TRACE("\n"); + } + } + else if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo) && mt->cbFormat >= sizeof(VIDEOINFOHEADER)) + { + VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)mt->pbFormat; + + if (!IsRectEmpty(&vih->rcSource)) TRACE("source %s, ", wine_dbgstr_rect(&vih->rcSource)); + if (!IsRectEmpty(&vih->rcTarget)) TRACE("target %s, ", wine_dbgstr_rect(&vih->rcTarget)); + if (vih->dwBitRate) TRACE("bitrate %u, ", vih->dwBitRate); + if (vih->dwBitErrorRate) TRACE("error rate %u, ", vih->dwBitErrorRate); + TRACE("%s sec/frame, ", debugstr_time(vih->AvgTimePerFrame)); + TRACE("size %dx%d, %u planes, %u bpp, compression %s, image size %u", + vih->bmiHeader.biWidth, vih->bmiHeader.biHeight, vih->bmiHeader.biPlanes, + vih->bmiHeader.biBitCount, debugstr_fourcc(vih->bmiHeader.biCompression), + vih->bmiHeader.biSizeImage); + if (vih->bmiHeader.biXPelsPerMeter || vih->bmiHeader.biYPelsPerMeter) + TRACE(", resolution %dx%d", vih->bmiHeader.biXPelsPerMeter, vih->bmiHeader.biYPelsPerMeter); + if (vih->bmiHeader.biClrUsed) TRACE(", %d colours", vih->bmiHeader.biClrUsed); + if (vih->bmiHeader.biClrImportant) TRACE(", %d important colours", vih->bmiHeader.biClrImportant); + TRACE(".\n"); + } + else if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo2) && mt->cbFormat >= sizeof(VIDEOINFOHEADER2)) + { + VIDEOINFOHEADER2 *vih = (VIDEOINFOHEADER2 *)mt->pbFormat; + + if (!IsRectEmpty(&vih->rcSource)) TRACE("source %s, ", wine_dbgstr_rect(&vih->rcSource)); + if (!IsRectEmpty(&vih->rcTarget)) TRACE("target %s, ", wine_dbgstr_rect(&vih->rcTarget)); + if (vih->dwBitRate) TRACE("bitrate %u, ", vih->dwBitRate); + if (vih->dwBitErrorRate) TRACE("error rate %u, ", vih->dwBitErrorRate); + TRACE("%s sec/frame, ", debugstr_time(vih->AvgTimePerFrame)); + if (vih->dwInterlaceFlags) TRACE("interlace flags %#x, ", vih->dwInterlaceFlags); + if (vih->dwCopyProtectFlags) TRACE("copy-protection flags %#x, ", vih->dwCopyProtectFlags); + TRACE("aspect ratio %u/%u, ", vih->dwPictAspectRatioX, vih->dwPictAspectRatioY); + if (vih->u.dwControlFlags) TRACE("control flags %#x, ", vih->u.dwControlFlags); + if (vih->u.dwControlFlags & AMCONTROL_COLORINFO_PRESENT) + { + const DXVA_ExtendedFormat *colorimetry = (const DXVA_ExtendedFormat *)&vih->u.dwControlFlags; + + TRACE("chroma site %#x, range %#x, matrix %#x, lighting %#x, primaries %#x, transfer function %#x, ", + colorimetry->VideoChromaSubsampling, colorimetry->NominalRange, colorimetry->VideoTransferMatrix, + colorimetry->VideoLighting, colorimetry->VideoPrimaries, colorimetry->VideoTransferFunction); + } + TRACE("size %dx%d, %u planes, %u bpp, compression %s, image size %u", + vih->bmiHeader.biWidth, vih->bmiHeader.biHeight, vih->bmiHeader.biPlanes, + vih->bmiHeader.biBitCount, debugstr_fourcc(vih->bmiHeader.biCompression), + vih->bmiHeader.biSizeImage); + if (vih->bmiHeader.biXPelsPerMeter || vih->bmiHeader.biYPelsPerMeter) + TRACE(", resolution %dx%d", vih->bmiHeader.biXPelsPerMeter, vih->bmiHeader.biYPelsPerMeter); + if (vih->bmiHeader.biClrUsed) TRACE(", %d colours", vih->bmiHeader.biClrUsed); + if (vih->bmiHeader.biClrImportant) TRACE(", %d important colours", vih->bmiHeader.biClrImportant); + TRACE(".\n"); + } + else + TRACE("not implemented for this format type.\n"); +} + +HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *dest, const AM_MEDIA_TYPE *src) +{ + *dest = *src; + if (src->pbFormat) + { + dest->pbFormat = CoTaskMemAlloc(src->cbFormat); + if (!dest->pbFormat) + return E_OUTOFMEMORY; + memcpy(dest->pbFormat, src->pbFormat, src->cbFormat); + } + if (dest->pUnk) + IUnknown_AddRef(dest->pUnk); + return S_OK; +} + +void WINAPI FreeMediaType(AM_MEDIA_TYPE * pMediaType) +{ + CoTaskMemFree(pMediaType->pbFormat); + pMediaType->pbFormat = NULL; + if (pMediaType->pUnk) + { + IUnknown_Release(pMediaType->pUnk); + pMediaType->pUnk = NULL; + } +} + +AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const * pSrc) +{ + AM_MEDIA_TYPE * pDest; + + pDest = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); + if (!pDest) + return NULL; + + if (FAILED(CopyMediaType(pDest, pSrc))) + { + CoTaskMemFree(pDest); + return NULL; + } + + return pDest; +} + +void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType) +{ + FreeMediaType(pMediaType); + CoTaskMemFree(pMediaType); +} diff --git a/wrappers/new-dlls/strmbase/outputqueue.c b/wrappers/new-dlls/strmbase/outputqueue.c new file mode 100644 index 00000000000..dbcc4b6d0dd --- /dev/null +++ b/wrappers/new-dlls/strmbase/outputqueue.c @@ -0,0 +1,275 @@ +/* + * Generic Implementation of COutputQueue + * + * Copyright 2011 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +enum {SAMPLE_PACKET, EOS_PACKET}; + +typedef struct tagQueuedEvent { + int type; + struct list entry; + + IMediaSample *pSample; +} QueuedEvent; + +static DWORD WINAPI OutputQueue_InitialThreadProc(LPVOID data) +{ + OutputQueue *This = (OutputQueue *)data; + return This->pFuncsTable->pfnThreadProc(This); +} + +static void OutputQueue_FreeSamples(OutputQueue *pOutputQueue) +{ + struct list *cursor, *cursor2; + LIST_FOR_EACH_SAFE(cursor, cursor2, &pOutputQueue->SampleList) + { + QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry); + list_remove(cursor); + HeapFree(GetProcessHeap(),0,qev); + } +} + +HRESULT WINAPI OutputQueue_Construct(struct strmbase_source *pInputPin, BOOL bAuto, + BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority, + const OutputQueueFuncTable *pFuncsTable, OutputQueue **ppOutputQueue) + +{ + BOOL threaded = FALSE; + DWORD tid; + + OutputQueue *This; + + if (!pInputPin || !pFuncsTable || !ppOutputQueue) + return E_INVALIDARG; + + *ppOutputQueue = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(OutputQueue)); + if (!*ppOutputQueue) + return E_OUTOFMEMORY; + + This = *ppOutputQueue; + This->pFuncsTable = pFuncsTable; + This->lBatchSize = lBatchSize; + This->bBatchExact = bBatchExact; + InitializeCriticalSection(&This->csQueue); + This->csQueue.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": OutputQueue.csQueue"); + list_init(&This->SampleList); + + This->pInputPin = pInputPin; + IPin_AddRef(&pInputPin->pin.IPin_iface); + + EnterCriticalSection(&This->csQueue); + if (bAuto && pInputPin->pMemInputPin) + threaded = IMemInputPin_ReceiveCanBlock(pInputPin->pMemInputPin) == S_OK; + else + threaded = bQueue; + + if (threaded) + { + This->hThread = CreateThread(NULL, 0, OutputQueue_InitialThreadProc, This, 0, &tid); + if (This->hThread) + { + SetThreadPriority(This->hThread, dwPriority); + This->hProcessQueue = CreateEventW(NULL, 0, 0, NULL); + } + } + LeaveCriticalSection(&This->csQueue); + + return S_OK; +} + +HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue) +{ + EnterCriticalSection(&pOutputQueue->csQueue); + OutputQueue_FreeSamples(pOutputQueue); + pOutputQueue->bTerminate = TRUE; + SetEvent(pOutputQueue->hProcessQueue); + LeaveCriticalSection(&pOutputQueue->csQueue); + + pOutputQueue->csQueue.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&pOutputQueue->csQueue); + CloseHandle(pOutputQueue->hProcessQueue); + + IPin_Release(&pOutputQueue->pInputPin->pin.IPin_iface); + HeapFree(GetProcessHeap(),0,pOutputQueue); + return S_OK; +} + +HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSample **ppSamples, LONG nSamples, LONG *nSamplesProcessed) +{ + HRESULT hr = S_OK; + int i; + + if (!pOutputQueue->pInputPin->pin.peer || !pOutputQueue->pInputPin->pMemInputPin) + return VFW_E_NOT_CONNECTED; + + if (!pOutputQueue->hThread) + { + IMemInputPin_AddRef(pOutputQueue->pInputPin->pMemInputPin); + hr = IMemInputPin_ReceiveMultiple(pOutputQueue->pInputPin->pMemInputPin,ppSamples, nSamples, nSamplesProcessed); + IMemInputPin_Release(pOutputQueue->pInputPin->pMemInputPin); + } + else + { + EnterCriticalSection(&pOutputQueue->csQueue); + *nSamplesProcessed = 0; + + for (i = 0; i < nSamples; i++) + { + QueuedEvent *qev = HeapAlloc(GetProcessHeap(),0,sizeof(QueuedEvent)); + if (!qev) + { + ERR("Out of Memory\n"); + hr = E_OUTOFMEMORY; + break; + } + qev->type = SAMPLE_PACKET; + qev->pSample = ppSamples[i]; + IMediaSample_AddRef(ppSamples[i]); + list_add_tail(&pOutputQueue->SampleList, &qev->entry); + (*nSamplesProcessed)++; + } + + if (!pOutputQueue->bBatchExact || list_count(&pOutputQueue->SampleList) >= pOutputQueue->lBatchSize) + SetEvent(pOutputQueue->hProcessQueue); + LeaveCriticalSection(&pOutputQueue->csQueue); + } + return hr; +} + +HRESULT WINAPI OutputQueue_Receive(OutputQueue *pOutputQueue, IMediaSample *pSample) +{ + LONG processed; + return OutputQueue_ReceiveMultiple(pOutputQueue,&pSample,1,&processed); +} + +VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue) +{ + if (pOutputQueue->hThread) + { + EnterCriticalSection(&pOutputQueue->csQueue); + if (!list_empty(&pOutputQueue->SampleList)) + { + pOutputQueue->bSendAnyway = TRUE; + SetEvent(pOutputQueue->hProcessQueue); + } + LeaveCriticalSection(&pOutputQueue->csQueue); + } +} + +VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue) +{ + IPin *peer; + + EnterCriticalSection(&pOutputQueue->csQueue); + if (pOutputQueue->hThread) + { + QueuedEvent *qev = HeapAlloc(GetProcessHeap(),0,sizeof(QueuedEvent)); + if (!qev) + { + ERR("Out of Memory\n"); + LeaveCriticalSection(&pOutputQueue->csQueue); + return; + } + qev->type = EOS_PACKET; + qev->pSample = NULL; + list_add_tail(&pOutputQueue->SampleList, &qev->entry); + } + else if ((peer = pOutputQueue->pInputPin->pin.peer)) + IPin_EndOfStream(peer); + LeaveCriticalSection(&pOutputQueue->csQueue); + /* Covers sending the Event to the worker Thread */ + OutputQueue_SendAnyway(pOutputQueue); +} + +DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue) +{ + do + { + EnterCriticalSection(&pOutputQueue->csQueue); + if (!list_empty(&pOutputQueue->SampleList) && + (!pOutputQueue->bBatchExact || + list_count(&pOutputQueue->SampleList) >= pOutputQueue->lBatchSize || + pOutputQueue->bSendAnyway + ) + ) + { + while (!list_empty(&pOutputQueue->SampleList)) + { + IMediaSample **ppSamples; + LONG nSamples; + LONG nSamplesProcessed; + struct list *cursor, *cursor2; + int i = 0; + + /* First Pass Process Samples */ + i = list_count(&pOutputQueue->SampleList); + ppSamples = HeapAlloc(GetProcessHeap(),0,sizeof(IMediaSample*) * i); + nSamples = 0; + LIST_FOR_EACH_SAFE(cursor, cursor2, &pOutputQueue->SampleList) + { + QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry); + if (qev->type == SAMPLE_PACKET) + ppSamples[nSamples++] = qev->pSample; + else + break; + list_remove(cursor); + HeapFree(GetProcessHeap(),0,qev); + } + + if (pOutputQueue->pInputPin->pin.peer && pOutputQueue->pInputPin->pMemInputPin) + { + IMemInputPin_AddRef(pOutputQueue->pInputPin->pMemInputPin); + LeaveCriticalSection(&pOutputQueue->csQueue); + IMemInputPin_ReceiveMultiple(pOutputQueue->pInputPin->pMemInputPin, ppSamples, nSamples, &nSamplesProcessed); + EnterCriticalSection(&pOutputQueue->csQueue); + IMemInputPin_Release(pOutputQueue->pInputPin->pMemInputPin); + } + for (i = 0; i < nSamples; i++) + IMediaSample_Release(ppSamples[i]); + HeapFree(GetProcessHeap(),0,ppSamples); + + /* Process Non-Samples */ + LIST_FOR_EACH_SAFE(cursor, cursor2, &pOutputQueue->SampleList) + { + QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry); + if (qev->type == EOS_PACKET) + { + IPin *peer; + if ((peer = pOutputQueue->pInputPin->pin.peer)) + IPin_EndOfStream(peer); + } + else if (qev->type == SAMPLE_PACKET) + break; + else + FIXME("Unhandled Event type %i\n",qev->type); + list_remove(cursor); + HeapFree(GetProcessHeap(),0,qev); + } + } + pOutputQueue->bSendAnyway = FALSE; + } + LeaveCriticalSection(&pOutputQueue->csQueue); + WaitForSingleObject(pOutputQueue->hProcessQueue, INFINITE); + } + while (!pOutputQueue->bTerminate); + return S_OK; +} diff --git a/wrappers/new-dlls/strmbase/pin.c b/wrappers/new-dlls/strmbase/pin.c new file mode 100644 index 00000000000..e815f7b82df --- /dev/null +++ b/wrappers/new-dlls/strmbase/pin.c @@ -0,0 +1,1215 @@ +/* + * Generic Implementation of IPin Interface + * + * Copyright 2003 Robert Shearman + * Copyright 2010 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static const IMemInputPinVtbl MemInputPin_Vtbl; + +typedef HRESULT (*SendPinFunc)( IPin *to, LPVOID arg ); + +struct enum_media_types +{ + IEnumMediaTypes IEnumMediaTypes_iface; + LONG refcount; + + unsigned int index, count; + struct strmbase_pin *pin; +}; + +static const IEnumMediaTypesVtbl enum_media_types_vtbl; + +static HRESULT enum_media_types_create(struct strmbase_pin *pin, IEnumMediaTypes **out) +{ + struct enum_media_types *object; + AM_MEDIA_TYPE mt; + + if (!out) + return E_POINTER; + + if (!(object = heap_alloc_zero(sizeof(*object)))) + { + *out = NULL; + return E_OUTOFMEMORY; + } + + object->IEnumMediaTypes_iface.lpVtbl = &enum_media_types_vtbl; + object->refcount = 1; + object->pin = pin; + IPin_AddRef(&pin->IPin_iface); + + if (pin->ops->pin_get_media_type) + { + while (pin->ops->pin_get_media_type(pin, object->count, &mt) == S_OK) + { + FreeMediaType(&mt); + ++object->count; + } + } + + TRACE("Created enumerator %p.\n", object); + *out = &object->IEnumMediaTypes_iface; + + return S_OK; +} + +static struct enum_media_types *impl_from_IEnumMediaTypes(IEnumMediaTypes *iface) +{ + return CONTAINING_RECORD(iface, struct enum_media_types, IEnumMediaTypes_iface); +} + +static HRESULT WINAPI enum_media_types_QueryInterface(IEnumMediaTypes *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IEnumMediaTypes)) + { + IEnumMediaTypes_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI enum_media_types_AddRef(IEnumMediaTypes *iface) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + ULONG refcount = InterlockedIncrement(&enummt->refcount); + TRACE("%p increasing refcount to %u.\n", enummt, refcount); + return refcount; +} + +static ULONG WINAPI enum_media_types_Release(IEnumMediaTypes *iface) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + ULONG refcount = InterlockedDecrement(&enummt->refcount); + + TRACE("%p decreasing refcount to %u.\n", enummt, refcount); + if (!refcount) + { + IPin_Release(&enummt->pin->IPin_iface); + heap_free(enummt); + } + return refcount; +} + +static HRESULT WINAPI enum_media_types_Next(IEnumMediaTypes *iface, ULONG count, + AM_MEDIA_TYPE **mts, ULONG *ret_count) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + AM_MEDIA_TYPE mt; + unsigned int i; + HRESULT hr; + + TRACE("enummt %p, count %u, mts %p, ret_count %p.\n", enummt, count, mts, ret_count); + + if (!enummt->pin->ops->pin_get_media_type) + { + if (ret_count) + *ret_count = 0; + return count ? S_FALSE : S_OK; + } + + for (i = 0; i < count; ++i) + { + hr = enummt->pin->ops->pin_get_media_type(enummt->pin, enummt->index + i, &mt); + if (hr == S_OK) + { + if ((mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)))) + *mts[i] = mt; + else + hr = E_OUTOFMEMORY; + } + if (FAILED(hr)) + { + while (i--) + DeleteMediaType(mts[i]); + *ret_count = 0; + return E_OUTOFMEMORY; + } + else if (hr != S_OK) + break; + + if (TRACE_ON(strmbase)) + { + TRACE("Returning media type %u:\n", enummt->index + i); + strmbase_dump_media_type(mts[i]); + } + } + + if (count != 1 || ret_count) + *ret_count = i; + enummt->index += i; + return i == count ? S_OK : S_FALSE; +} + +static HRESULT WINAPI enum_media_types_Skip(IEnumMediaTypes *iface, ULONG count) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + + TRACE("enummt %p, count %u.\n", enummt, count); + + enummt->index += count; + + return enummt->index > enummt->count ? S_FALSE : S_OK; +} + +static HRESULT WINAPI enum_media_types_Reset(IEnumMediaTypes *iface) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + AM_MEDIA_TYPE mt; + + TRACE("enummt %p.\n", enummt); + + enummt->count = 0; + if (enummt->pin->ops->pin_get_media_type) + { + while (enummt->pin->ops->pin_get_media_type(enummt->pin, enummt->count, &mt) == S_OK) + { + FreeMediaType(&mt); + ++enummt->count; + } + } + + enummt->index = 0; + + return S_OK; +} + +static HRESULT WINAPI enum_media_types_Clone(IEnumMediaTypes *iface, IEnumMediaTypes **out) +{ + struct enum_media_types *enummt = impl_from_IEnumMediaTypes(iface); + HRESULT hr; + + TRACE("enummt %p, out %p.\n", enummt, out); + + if (FAILED(hr = enum_media_types_create(enummt->pin, out))) + return hr; + return IEnumMediaTypes_Skip(*out, enummt->index); +} + +static const IEnumMediaTypesVtbl enum_media_types_vtbl = +{ + enum_media_types_QueryInterface, + enum_media_types_AddRef, + enum_media_types_Release, + enum_media_types_Next, + enum_media_types_Skip, + enum_media_types_Reset, + enum_media_types_Clone, +}; + +static inline struct strmbase_pin *impl_from_IPin(IPin *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface); +} + +/** Helper function, there are a lot of places where the error code is inherited + * The following rules apply: + * + * Return the first received error code (E_NOTIMPL is ignored) + * If no errors occur: return the first received non-error-code that isn't S_OK + */ +static HRESULT updatehres( HRESULT original, HRESULT new ) +{ + if (FAILED( original ) || new == E_NOTIMPL) + return original; + + if (FAILED( new ) || original == S_OK) + return new; + + return original; +} + +/** Sends a message from a pin further to other, similar pins + * fnMiddle is called on each pin found further on the stream. + * fnEnd (can be NULL) is called when the message can't be sent any further (this is a renderer or source) + * + * If the pin given is an input pin, the message will be sent downstream to other input pins + * If the pin given is an output pin, the message will be sent upstream to other output pins + */ +static HRESULT SendFurther(struct strmbase_sink *sink, SendPinFunc func, void *arg) +{ + struct strmbase_pin *pin; + HRESULT hr = S_OK; + unsigned int i; + + for (i = 0; (pin = sink->pin.filter->ops->filter_get_pin(sink->pin.filter, i)); ++i) + { + if (pin->dir == PINDIR_OUTPUT && pin->peer) + hr = updatehres(hr, func(pin->peer, arg)); + } + + return hr; +} + +static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + HRESULT hr; + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + *out = NULL; + + if (pin->ops->pin_query_interface && SUCCEEDED(hr = pin->ops->pin_query_interface(pin, iid, out))) + return hr; + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IPin)) + *out = iface; + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI pin_AddRef(IPin *iface) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface); +} + +static ULONG WINAPI pin_Release(IPin *iface) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + return IBaseFilter_Release(&pin->filter->IBaseFilter_iface); +} + +static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin) +{ + struct strmbase_pin *This = impl_from_IPin(iface); + HRESULT hr; + + TRACE("pin %p %s:%s, peer %p.\n", This, debugstr_w(This->filter->name), debugstr_w(This->name), ppPin); + + EnterCriticalSection(&This->filter->filter_cs); + { + if (This->peer) + { + *ppPin = This->peer; + IPin_AddRef(*ppPin); + hr = S_OK; + } + else + { + hr = VFW_E_NOT_CONNECTED; + *ppPin = NULL; + } + } + LeaveCriticalSection(&This->filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt) +{ + struct strmbase_pin *This = impl_from_IPin(iface); + HRESULT hr; + + TRACE("pin %p %s:%s, pmt %p.\n", This, debugstr_w(This->filter->name), debugstr_w(This->name), pmt); + + EnterCriticalSection(&This->filter->filter_cs); + { + if (This->peer) + { + CopyMediaType(pmt, &This->mt); + strmbase_dump_media_type(pmt); + hr = S_OK; + } + else + { + ZeroMemory(pmt, sizeof(*pmt)); + hr = VFW_E_NOT_CONNECTED; + } + } + LeaveCriticalSection(&This->filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + + TRACE("pin %p %s:%s, info %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), info); + + info->dir = pin->dir; + IBaseFilter_AddRef(info->pFilter = &pin->filter->IBaseFilter_iface); + lstrcpyW(info->achName, pin->name); + + return S_OK; +} + +static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + + TRACE("pin %p %s:%s, dir %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), dir); + + *dir = pin->dir; + + return S_OK; +} + +static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + + TRACE("pin %p %s:%s, id %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), id); + + if (!(*id = CoTaskMemAlloc((lstrlenW(pin->name) + 1) * sizeof(WCHAR)))) + return E_OUTOFMEMORY; + + lstrcpyW(*id, pin->name); + + return S_OK; +} + +static BOOL query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) +{ + if (pin->ops->pin_query_accept && pin->ops->pin_query_accept(pin, mt) != S_OK) + return FALSE; + return TRUE; +} + +static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + + TRACE("pin %p %s:%s, mt %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), mt); + strmbase_dump_media_type(mt); + + return query_accept(pin, mt) ? S_OK : S_FALSE; +} + +static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + AM_MEDIA_TYPE mt; + HRESULT hr; + + TRACE("pin %p %s:%s, enum_media_types %p.\n", pin, debugstr_w(pin->filter->name), + debugstr_w(pin->name), enum_media_types); + + if (pin->ops->pin_get_media_type) + { + if (FAILED(hr = pin->ops->pin_get_media_type(pin, 0, &mt))) + return hr; + if (hr == S_OK) + FreeMediaType(&mt); + } + + return enum_media_types_create(pin, enum_media_types); +} + +static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **pins, ULONG *count) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + + TRACE("pin %p %s:%s, pins %p, count %p.\n", pin, debugstr_w(pin->filter->name), + debugstr_w(pin->name), pins, count); + + return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */ +} + +/*** OutputPin implementation ***/ + +static inline struct strmbase_source *impl_source_from_IPin( IPin *iface ) +{ + return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface); +} + +static BOOL compare_media_types(const AM_MEDIA_TYPE *req_mt, const AM_MEDIA_TYPE *pin_mt) +{ + if (!req_mt) + return TRUE; + + if (!IsEqualGUID(&req_mt->majortype, &pin_mt->majortype) + && !IsEqualGUID(&req_mt->majortype, &GUID_NULL)) + return FALSE; + + if (!IsEqualGUID(&req_mt->subtype, &pin_mt->subtype) + && !IsEqualGUID(&req_mt->subtype, &GUID_NULL)) + return FALSE; + + if (!IsEqualGUID(&req_mt->formattype, &pin_mt->formattype) + && !IsEqualGUID(&req_mt->formattype, &GUID_NULL)) + return FALSE; + + return TRUE; +} + +static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + AM_MEDIA_TYPE candidate, *candidate_ptr; + IEnumMediaTypes *enummt; + PIN_DIRECTION dir; + unsigned int i; + ULONG count; + HRESULT hr; + + TRACE("pin %p %s:%s, peer %p, mt %p.\n", pin, debugstr_w(pin->pin.filter->name), + debugstr_w(pin->pin.name), peer, mt); + strmbase_dump_media_type(mt); + + if (!peer) + return E_POINTER; + + IPin_QueryDirection(peer, &dir); + if (dir != PINDIR_INPUT) + { + WARN("Attempt to connect to another source pin, returning VFW_E_INVALID_DIRECTION.\n"); + return VFW_E_INVALID_DIRECTION; + } + + EnterCriticalSection(&pin->pin.filter->filter_cs); + + if (pin->pin.peer) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + WARN("Pin is already connected, returning VFW_E_ALREADY_CONNECTED.\n"); + return VFW_E_ALREADY_CONNECTED; + } + + if (pin->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + + /* We don't check the subtype here. The rationale (as given by the DirectX + * documentation) is that the format type is supposed to provide at least + * as much information as the subtype. */ + if (mt && !IsEqualGUID(&mt->majortype, &GUID_NULL) + && !IsEqualGUID(&mt->formattype, &GUID_NULL)) + { + hr = pin->pFuncsTable->pfnAttemptConnection(pin, peer, mt); + LeaveCriticalSection(&pin->pin.filter->filter_cs); + return hr; + } + + if (pin->pFuncsTable->base.pin_get_media_type) + { + for (i = 0; pin->pFuncsTable->base.pin_get_media_type(&pin->pin, i, &candidate) == S_OK; ++i) + { + strmbase_dump_media_type(&candidate); + if (compare_media_types(mt, &candidate) + && pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + FreeMediaType(&candidate); + return S_OK; + } + FreeMediaType(&candidate); + } + } + + if (SUCCEEDED(IPin_EnumMediaTypes(peer, &enummt))) + { + while (IEnumMediaTypes_Next(enummt, 1, &candidate_ptr, &count) == S_OK) + { + if (compare_media_types(mt, candidate_ptr) + && pin->pFuncsTable->pfnAttemptConnection(pin, peer, candidate_ptr) == S_OK) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + DeleteMediaType(candidate_ptr); + IEnumMediaTypes_Release(enummt); + return S_OK; + } + DeleteMediaType(candidate_ptr); + } + + IEnumMediaTypes_Release(enummt); + } + + LeaveCriticalSection(&pin->pin.filter->filter_cs); + + return VFW_E_NO_ACCEPTABLE_TYPES; +} + +static HRESULT WINAPI source_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + + WARN("pin %p %s:%s, peer %p, mt %p, unexpected call.\n", pin, + debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name), peer, mt); + + return E_UNEXPECTED; +} + +static HRESULT WINAPI source_Disconnect(IPin *iface) +{ + HRESULT hr; + struct strmbase_source *This = impl_source_from_IPin(iface); + + TRACE("pin %p %s:%s.\n", This, debugstr_w(This->pin.filter->name), debugstr_w(This->pin.name)); + + EnterCriticalSection(&This->pin.filter->filter_cs); + { + if (This->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&This->pin.filter->filter_cs); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + + if (This->pFuncsTable->source_disconnect) + This->pFuncsTable->source_disconnect(This); + + if (This->pMemInputPin) + { + IMemInputPin_Release(This->pMemInputPin); + This->pMemInputPin = NULL; + } + + if (This->pAllocator) + { + IMemAllocator_Release(This->pAllocator); + This->pAllocator = NULL; + } + + if (This->pin.peer) + { + IPin_Release(This->pin.peer); + This->pin.peer = NULL; + FreeMediaType(&This->pin.mt); + ZeroMemory(&This->pin.mt, sizeof(This->pin.mt)); + hr = S_OK; + } + else + hr = S_FALSE; + } + LeaveCriticalSection(&This->pin.filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI source_EndOfStream(IPin *iface) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + + WARN("pin %p %s:%s, unexpected call.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + /* not supposed to do anything in an output pin */ + + return E_UNEXPECTED; +} + +static HRESULT WINAPI source_BeginFlush(IPin *iface) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + + WARN("pin %p %s:%s, unexpected call.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + /* not supposed to do anything in an output pin */ + + return E_UNEXPECTED; +} + +static HRESULT WINAPI source_EndFlush(IPin *iface) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + + WARN("pin %p %s:%s, unexpected call.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + /* not supposed to do anything in an output pin */ + + return E_UNEXPECTED; +} + +static HRESULT WINAPI source_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate) +{ + struct strmbase_source *pin = impl_source_from_IPin(iface); + + TRACE("pin %p %s:%s, start %s, stop %s, rate %.16e.\n", pin, debugstr_w(pin->pin.filter->name), + debugstr_w(pin->pin.name), debugstr_time(start), debugstr_time(stop), rate); + + return S_OK; +} + +static const IPinVtbl source_vtbl = +{ + pin_QueryInterface, + pin_AddRef, + pin_Release, + source_Connect, + source_ReceiveConnection, + source_Disconnect, + pin_ConnectedTo, + pin_ConnectionMediaType, + pin_QueryPinInfo, + pin_QueryDirection, + pin_QueryId, + pin_QueryAccept, + pin_EnumMediaTypes, + pin_QueryInternalConnections, + source_EndOfStream, + source_BeginFlush, + source_EndFlush, + source_NewSegment, +}; + +HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This, + IMediaSample **ppSample, REFERENCE_TIME *tStart, REFERENCE_TIME *tStop, DWORD dwFlags) +{ + HRESULT hr; + + TRACE("(%p)->(%p, %p, %p, %x)\n", This, ppSample, tStart, tStop, dwFlags); + + if (!This->pin.peer) + hr = VFW_E_NOT_CONNECTED; + else + { + hr = IMemAllocator_GetBuffer(This->pAllocator, ppSample, tStart, tStop, dwFlags); + + if (SUCCEEDED(hr)) + hr = IMediaSample_SetTime(*ppSample, tStart, tStop); + } + + return hr; +} + +HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *This, IMemAllocator **pMemAlloc) +{ + return CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)pMemAlloc); +} + +HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *This, + IMemInputPin *pPin, IMemAllocator **pAlloc) +{ + HRESULT hr; + + hr = IMemInputPin_GetAllocator(pPin, pAlloc); + + if (hr == VFW_E_NO_ALLOCATOR) + /* Input pin provides no allocator, use standard memory allocator */ + hr = BaseOutputPinImpl_InitAllocator(This, pAlloc); + + if (SUCCEEDED(hr)) + { + ALLOCATOR_PROPERTIES rProps; + ZeroMemory(&rProps, sizeof(ALLOCATOR_PROPERTIES)); + + IMemInputPin_GetAllocatorRequirements(pPin, &rProps); + hr = This->pFuncsTable->pfnDecideBufferSize(This, *pAlloc, &rProps); + } + + if (SUCCEEDED(hr)) + hr = IMemInputPin_NotifyAllocator(pPin, *pAlloc, FALSE); + + return hr; +} + +/*** The Construct functions ***/ + +/* Function called as a helper to IPin_Connect */ +/* specific AM_MEDIA_TYPE - it cannot be NULL */ +HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, + IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) +{ + HRESULT hr; + IMemAllocator * pMemAlloc = NULL; + + TRACE("(%p)->(%p, %p)\n", This, pReceivePin, pmt); + + if (!query_accept(&This->pin, pmt)) + return VFW_E_TYPE_NOT_ACCEPTED; + + This->pin.peer = pReceivePin; + IPin_AddRef(pReceivePin); + CopyMediaType(&This->pin.mt, pmt); + + hr = IPin_ReceiveConnection(pReceivePin, &This->pin.IPin_iface, pmt); + + /* get the IMemInputPin interface we will use to deliver samples to the + * connected pin */ + if (SUCCEEDED(hr)) + { + This->pMemInputPin = NULL; + hr = IPin_QueryInterface(pReceivePin, &IID_IMemInputPin, (LPVOID)&This->pMemInputPin); + + if (SUCCEEDED(hr)) + { + hr = This->pFuncsTable->pfnDecideAllocator(This, This->pMemInputPin, &pMemAlloc); + if (SUCCEEDED(hr)) + This->pAllocator = pMemAlloc; + else if (pMemAlloc) + IMemAllocator_Release(pMemAlloc); + } + + /* break connection if we couldn't get the allocator */ + if (FAILED(hr)) + { + if (This->pMemInputPin) + IMemInputPin_Release(This->pMemInputPin); + This->pMemInputPin = NULL; + + IPin_Disconnect(pReceivePin); + } + } + + if (FAILED(hr)) + { + IPin_Release(This->pin.peer); + This->pin.peer = NULL; + FreeMediaType(&This->pin.mt); + } + + TRACE(" -- %x\n", hr); + return hr; +} + +void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, + const WCHAR *name, const struct strmbase_source_ops *func_table) +{ + memset(pin, 0, sizeof(*pin)); + pin->pin.IPin_iface.lpVtbl = &source_vtbl; + pin->pin.filter = filter; + pin->pin.dir = PINDIR_OUTPUT; + lstrcpyW(pin->pin.name, name); + pin->pin.ops = &func_table->base; + pin->pFuncsTable = func_table; +} + +void strmbase_source_cleanup(struct strmbase_source *pin) +{ + FreeMediaType(&pin->pin.mt); + if (pin->pAllocator) + IMemAllocator_Release(pin->pAllocator); + pin->pAllocator = NULL; +} + +static struct strmbase_sink *impl_sink_from_IPin(IPin *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface); +} + +static HRESULT WINAPI sink_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + + WARN("pin %p %s:%s, peer %p, mt %p, unexpected call.\n", pin, debugstr_w(pin->pin.name), + debugstr_w(pin->pin.filter->name), peer, mt); + + return E_UNEXPECTED; +} + + +static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) +{ + struct strmbase_sink *This = impl_sink_from_IPin(iface); + PIN_DIRECTION pindirReceive; + HRESULT hr = S_OK; + + TRACE("pin %p %s:%s, peer %p, mt %p.\n", This, debugstr_w(This->pin.filter->name), + debugstr_w(This->pin.name), pReceivePin, pmt); + strmbase_dump_media_type(pmt); + + if (!pmt) + return E_POINTER; + + EnterCriticalSection(&This->pin.filter->filter_cs); + { + if (This->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&This->pin.filter->filter_cs); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + + if (This->pin.peer) + hr = VFW_E_ALREADY_CONNECTED; + + if (SUCCEEDED(hr) && !query_accept(&This->pin, pmt)) + hr = VFW_E_TYPE_NOT_ACCEPTED; /* FIXME: shouldn't we just map common errors onto + * VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */ + + if (SUCCEEDED(hr)) + { + IPin_QueryDirection(pReceivePin, &pindirReceive); + + if (pindirReceive != PINDIR_OUTPUT) + { + ERR("Can't connect from non-output pin\n"); + hr = VFW_E_INVALID_DIRECTION; + } + } + + if (SUCCEEDED(hr) && This->pFuncsTable->sink_connect) + hr = This->pFuncsTable->sink_connect(This, pReceivePin, pmt); + + if (SUCCEEDED(hr)) + { + CopyMediaType(&This->pin.mt, pmt); + This->pin.peer = pReceivePin; + IPin_AddRef(pReceivePin); + } + } + LeaveCriticalSection(&This->pin.filter->filter_cs); + + return hr; +} + +static HRESULT WINAPI sink_Disconnect(IPin *iface) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + HRESULT hr; + + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + EnterCriticalSection(&pin->pin.filter->filter_cs); + + if (pin->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + + if (pin->pin.peer) + { + if (pin->pFuncsTable->sink_disconnect) + pin->pFuncsTable->sink_disconnect(pin); + + if (pin->pAllocator) + { + IMemAllocator_Release(pin->pAllocator); + pin->pAllocator = NULL; + } + + IPin_Release(pin->pin.peer); + pin->pin.peer = NULL; + FreeMediaType(&pin->pin.mt); + memset(&pin->pin.mt, 0, sizeof(AM_MEDIA_TYPE)); + hr = S_OK; + } + else + hr = S_FALSE; + + LeaveCriticalSection(&pin->pin.filter->filter_cs); + + return hr; +} + +static HRESULT deliver_endofstream(IPin* pin, LPVOID unused) +{ + return IPin_EndOfStream( pin ); +} + +static HRESULT WINAPI sink_EndOfStream(IPin *iface) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + HRESULT hr = S_OK; + + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + if (pin->pFuncsTable->sink_eos) + { + EnterCriticalSection(&pin->pin.filter->stream_cs); + hr = pin->pFuncsTable->sink_eos(pin); + LeaveCriticalSection(&pin->pin.filter->stream_cs); + return hr; + } + + EnterCriticalSection(&pin->pin.filter->filter_cs); + if (pin->flushing) + hr = S_FALSE; + LeaveCriticalSection(&pin->pin.filter->filter_cs); + + if (hr == S_OK) + hr = SendFurther(pin, deliver_endofstream, NULL); + return hr; +} + +static HRESULT deliver_beginflush(IPin* pin, LPVOID unused) +{ + return IPin_BeginFlush( pin ); +} + +static HRESULT WINAPI sink_BeginFlush(IPin *iface) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + HRESULT hr; + + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + EnterCriticalSection(&pin->pin.filter->filter_cs); + + pin->flushing = TRUE; + + if (pin->pFuncsTable->sink_begin_flush) + hr = pin->pFuncsTable->sink_begin_flush(pin); + else + hr = SendFurther(pin, deliver_beginflush, NULL); + + LeaveCriticalSection(&pin->pin.filter->filter_cs); + + return hr; +} + +static HRESULT deliver_endflush(IPin* pin, LPVOID unused) +{ + return IPin_EndFlush( pin ); +} + +static HRESULT WINAPI sink_EndFlush(IPin * iface) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + HRESULT hr; + + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + EnterCriticalSection(&pin->pin.filter->filter_cs); + + pin->flushing = FALSE; + + if (pin->pFuncsTable->sink_end_flush) + hr = pin->pFuncsTable->sink_end_flush(pin); + else + hr = SendFurther(pin, deliver_endflush, NULL); + + LeaveCriticalSection(&pin->pin.filter->filter_cs); + + return hr; +} + +typedef struct newsegmentargs +{ + REFERENCE_TIME tStart, tStop; + double rate; +} newsegmentargs; + +static HRESULT deliver_newsegment(IPin *pin, LPVOID data) +{ + newsegmentargs *args = data; + return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate); +} + +static HRESULT WINAPI sink_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate) +{ + struct strmbase_sink *pin = impl_sink_from_IPin(iface); + newsegmentargs args; + + TRACE("pin %p %s:%s, start %s, stop %s, rate %.16e.\n", pin, debugstr_w(pin->pin.filter->name), + debugstr_w(pin->pin.name), debugstr_time(start), debugstr_time(stop), rate); + + if (pin->pFuncsTable->sink_new_segment) + return pin->pFuncsTable->sink_new_segment(pin, start, stop, rate); + + args.tStart = start; + args.tStop = stop; + args.rate = rate; + + return SendFurther(pin, deliver_newsegment, &args); +} + +static const IPinVtbl sink_vtbl = +{ + pin_QueryInterface, + pin_AddRef, + pin_Release, + sink_Connect, + sink_ReceiveConnection, + sink_Disconnect, + pin_ConnectedTo, + pin_ConnectionMediaType, + pin_QueryPinInfo, + pin_QueryDirection, + pin_QueryId, + pin_QueryAccept, + pin_EnumMediaTypes, + pin_QueryInternalConnections, + sink_EndOfStream, + sink_BeginFlush, + sink_EndFlush, + sink_NewSegment, +}; + +/*** IMemInputPin implementation ***/ + +static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_sink, IMemInputPin_iface); +} + +static HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv) +{ + struct strmbase_sink *This = impl_from_IMemInputPin(iface); + + return IPin_QueryInterface(&This->pin.IPin_iface, riid, ppv); +} + +static ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface) +{ + struct strmbase_sink *This = impl_from_IMemInputPin(iface); + + return IPin_AddRef(&This->pin.IPin_iface); +} + +static ULONG WINAPI MemInputPin_Release(IMemInputPin * iface) +{ + struct strmbase_sink *This = impl_from_IMemInputPin(iface); + + return IPin_Release(&This->pin.IPin_iface); +} + +static HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator) +{ + struct strmbase_sink *This = impl_from_IMemInputPin(iface); + + TRACE("pin %p %s:%s, allocator %p.\n", This, debugstr_w(This->pin.filter->name), + debugstr_w(This->pin.name), ppAllocator); + + *ppAllocator = This->pAllocator; + if (*ppAllocator) + IMemAllocator_AddRef(*ppAllocator); + + return *ppAllocator ? S_OK : VFW_E_NO_ALLOCATOR; +} + +static HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly) +{ + struct strmbase_sink *This = impl_from_IMemInputPin(iface); + + TRACE("pin %p %s:%s, allocator %p, read_only %d.\n", This, debugstr_w(This->pin.filter->name), + debugstr_w(This->pin.name), pAllocator, bReadOnly); + + if (bReadOnly) + FIXME("Read only flag not handled yet!\n"); + + /* FIXME: Should we release the allocator on disconnection? */ + if (!pAllocator) + { + WARN("Null allocator\n"); + return E_POINTER; + } + + if (This->preferred_allocator && pAllocator != This->preferred_allocator) + return E_FAIL; + + if (This->pAllocator) + IMemAllocator_Release(This->pAllocator); + This->pAllocator = pAllocator; + if (This->pAllocator) + IMemAllocator_AddRef(This->pAllocator); + + return S_OK; +} + +static HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props) +{ + struct strmbase_sink *pin = impl_from_IMemInputPin(iface); + + TRACE("pin %p %s:%s, props %p.\n", pin, debugstr_w(pin->pin.filter->name), + debugstr_w(pin->pin.name), props); + + /* override this method if you have any specific requirements */ + + return E_NOTIMPL; +} + +static HRESULT WINAPI MemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample) +{ + struct strmbase_sink *pin = impl_from_IMemInputPin(iface); + HRESULT hr = S_FALSE; + + TRACE("pin %p %s:%s, sample %p.\n", pin, debugstr_w(pin->pin.filter->name), + debugstr_w(pin->pin.name), sample); + + if (pin->pFuncsTable->pfnReceive) + { + EnterCriticalSection(&pin->pin.filter->stream_cs); + hr = pin->pFuncsTable->pfnReceive(pin, sample); + LeaveCriticalSection(&pin->pin.filter->stream_cs); + } + return hr; +} + +static HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, LONG nSamples, LONG *nSamplesProcessed) +{ + HRESULT hr = S_OK; + + for (*nSamplesProcessed = 0; *nSamplesProcessed < nSamples; (*nSamplesProcessed)++) + { + hr = IMemInputPin_Receive(iface, pSamples[*nSamplesProcessed]); + if (hr != S_OK) + break; + } + + return hr; +} + +static HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface) +{ + struct strmbase_sink *pin = impl_from_IMemInputPin(iface); + + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name)); + + return S_OK; +} + +static const IMemInputPinVtbl MemInputPin_Vtbl = +{ + MemInputPin_QueryInterface, + MemInputPin_AddRef, + MemInputPin_Release, + MemInputPin_GetAllocator, + MemInputPin_NotifyAllocator, + MemInputPin_GetAllocatorRequirements, + MemInputPin_Receive, + MemInputPin_ReceiveMultiple, + MemInputPin_ReceiveCanBlock +}; + +void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, + const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator) +{ + memset(pin, 0, sizeof(*pin)); + pin->pin.IPin_iface.lpVtbl = &sink_vtbl; + pin->pin.filter = filter; + pin->pin.dir = PINDIR_INPUT; + lstrcpyW(pin->pin.name, name); + pin->pin.ops = &func_table->base; + pin->pFuncsTable = func_table; + pin->pAllocator = pin->preferred_allocator = allocator; + if (pin->preferred_allocator) + IMemAllocator_AddRef(pin->preferred_allocator); + pin->IMemInputPin_iface.lpVtbl = &MemInputPin_Vtbl; +} + +void strmbase_sink_cleanup(struct strmbase_sink *pin) +{ + FreeMediaType(&pin->pin.mt); + if (pin->pAllocator) + IMemAllocator_Release(pin->pAllocator); + pin->pAllocator = NULL; + pin->pin.IPin_iface.lpVtbl = NULL; +} diff --git a/wrappers/new-dlls/strmbase/pospass.c b/wrappers/new-dlls/strmbase/pospass.c new file mode 100644 index 00000000000..b9e6f23a974 --- /dev/null +++ b/wrappers/new-dlls/strmbase/pospass.c @@ -0,0 +1,766 @@ +/* + * Filter Seeking and Control Interfaces + * + * Copyright 2003 Robert Shearman + * Copyright 2012 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +/* FIXME: critical sections */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static struct strmbase_passthrough *impl_from_ISeekingPassThru(ISeekingPassThru *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_passthrough, ISeekingPassThru_iface); +} + +static struct strmbase_passthrough *impl_from_IMediaSeeking(IMediaSeeking *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_passthrough, IMediaSeeking_iface); +} + +static struct strmbase_passthrough *impl_from_IMediaPosition(IMediaPosition *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_passthrough, IMediaPosition_iface); +} + +static HRESULT WINAPI SeekingPassThru_QueryInterface(ISeekingPassThru *iface, REFIID iid, void **out) +{ + struct strmbase_passthrough *passthrough = impl_from_ISeekingPassThru(iface); + + return IUnknown_QueryInterface(passthrough->outer_unk, iid, out); +} + +static ULONG WINAPI SeekingPassThru_AddRef(ISeekingPassThru *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_ISeekingPassThru(iface); + + return IUnknown_AddRef(passthrough->outer_unk); +} + +static ULONG WINAPI SeekingPassThru_Release(ISeekingPassThru *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_ISeekingPassThru(iface); + + return IUnknown_Release(passthrough->outer_unk); +} + +static HRESULT WINAPI SeekingPassThru_Init(ISeekingPassThru *iface, BOOL renderer, IPin *pin) +{ + struct strmbase_passthrough *This = impl_from_ISeekingPassThru(iface); + + TRACE("(%p/%p)->(%d, %p)\n", This, iface, renderer, pin); + + if (This->pin) + FIXME("Re-initializing?\n"); + + This->renderer = renderer; + This->pin = pin; + + return S_OK; +} + +static const ISeekingPassThruVtbl ISeekingPassThru_Vtbl = +{ + SeekingPassThru_QueryInterface, + SeekingPassThru_AddRef, + SeekingPassThru_Release, + SeekingPassThru_Init +}; + +static HRESULT WINAPI MediaSeekingPassThru_QueryInterface(IMediaSeeking *iface, REFIID iid, void **out) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaSeeking(iface); + + return IUnknown_QueryInterface(passthrough->outer_unk, iid, out); +} + +static ULONG WINAPI MediaSeekingPassThru_AddRef(IMediaSeeking *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaSeeking(iface); + + return IUnknown_AddRef(passthrough->outer_unk); +} + +static ULONG WINAPI MediaSeekingPassThru_Release(IMediaSeeking *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaSeeking(iface); + + return IUnknown_Release(passthrough->outer_unk); +} + +static HRESULT get_connected(struct strmbase_passthrough *This, REFIID riid, void **ppvObj) +{ + HRESULT hr; + IPin *pin; + *ppvObj = NULL; + hr = IPin_ConnectedTo(This->pin, &pin); + if (FAILED(hr)) + return VFW_E_NOT_CONNECTED; + hr = IPin_QueryInterface(pin, riid, ppvObj); + IPin_Release(pin); + if (FAILED(hr)) + hr = E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetCapabilities(seek, pCapabilities); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_CheckCapabilities(seek, pCapabilities); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat)); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_IsFormatSupported(seek, pFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pFormat); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_QueryPreferredFormat(seek, pFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pFormat); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetTimeFormat(seek, pFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat)); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_IsUsingTimeFormat(seek, pFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat)); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_SetTimeFormat(seek, pFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pDuration); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetDuration(seek, pDuration); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, pStop); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetStopPosition(seek, pStop); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr = S_OK; + TRACE("(%p/%p)->(%p)\n", iface, This, pCurrent); + if (!pCurrent) + return E_POINTER; + EnterCriticalSection(&This->time_cs); + if (This->timevalid) + *pCurrent = This->time_earliest; + else + hr = E_FAIL; + LeaveCriticalSection(&This->time_cs); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_ConvertTimeFormat(iface, pCurrent, NULL, *pCurrent, &TIME_FORMAT_MEDIA_TIME); + return hr; + } + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetCurrentPosition(seek, pCurrent); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p,%s,%x%08x,%s)\n", iface, This, pTarget, debugstr_guid(pTargetFormat), (DWORD)(Source>>32), (DWORD)Source, debugstr_guid(pSourceFormat)); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_ConvertTimeFormat(seek, pTarget, pTargetFormat, Source, pSourceFormat); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p,%x,%p,%x)\n", iface, This, pCurrent, dwCurrentFlags, pStop, dwStopFlags); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_SetPositions(seek, pCurrent, dwCurrentFlags, pStop, dwStopFlags); + IMediaSeeking_Release(seek); + } else if (hr == VFW_E_NOT_CONNECTED) + hr = S_OK; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p, %p)\n", iface, This, pCurrent, pStop); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetPositions(seek, pCurrent, pStop); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p,%p)\n", iface, This, pEarliest, pLatest); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetAvailable(seek, pEarliest, pLatest); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_SetRate(IMediaSeeking * iface, double dRate) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%e)\n", iface, This, dRate); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_SetRate(seek, dRate); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetRate(IMediaSeeking * iface, double * dRate) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p/%p)->(%p)\n", iface, This, dRate); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetRate(seek, dRate); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaSeekingPassThru_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll) +{ + struct strmbase_passthrough *This = impl_from_IMediaSeeking(iface); + IMediaSeeking *seek; + HRESULT hr; + TRACE("(%p)\n", pPreroll); + hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); + if (SUCCEEDED(hr)) { + hr = IMediaSeeking_GetPreroll(seek, pPreroll); + IMediaSeeking_Release(seek); + } + else + return E_NOTIMPL; + return hr; +} + +static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl = +{ + MediaSeekingPassThru_QueryInterface, + MediaSeekingPassThru_AddRef, + MediaSeekingPassThru_Release, + MediaSeekingPassThru_GetCapabilities, + MediaSeekingPassThru_CheckCapabilities, + MediaSeekingPassThru_IsFormatSupported, + MediaSeekingPassThru_QueryPreferredFormat, + MediaSeekingPassThru_GetTimeFormat, + MediaSeekingPassThru_IsUsingTimeFormat, + MediaSeekingPassThru_SetTimeFormat, + MediaSeekingPassThru_GetDuration, + MediaSeekingPassThru_GetStopPosition, + MediaSeekingPassThru_GetCurrentPosition, + MediaSeekingPassThru_ConvertTimeFormat, + MediaSeekingPassThru_SetPositions, + MediaSeekingPassThru_GetPositions, + MediaSeekingPassThru_GetAvailable, + MediaSeekingPassThru_SetRate, + MediaSeekingPassThru_GetRate, + MediaSeekingPassThru_GetPreroll +}; + +static HRESULT WINAPI MediaPositionPassThru_QueryInterface(IMediaPosition *iface, REFIID iid, void **out) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaPosition(iface); + + return IUnknown_QueryInterface(passthrough->outer_unk, iid, out); +} + +static ULONG WINAPI MediaPositionPassThru_AddRef(IMediaPosition *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaPosition(iface); + + return IUnknown_AddRef(passthrough->outer_unk); +} + +static ULONG WINAPI MediaPositionPassThru_Release(IMediaPosition *iface) +{ + struct strmbase_passthrough *passthrough = impl_from_IMediaPosition(iface); + + return IUnknown_Release(passthrough->outer_unk); +} + +static HRESULT WINAPI MediaPositionPassThru_GetTypeInfoCount(IMediaPosition *iface, UINT *count) +{ + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; +} + +static HRESULT WINAPI MediaPositionPassThru_GetTypeInfo(IMediaPosition *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) +{ + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IMediaPosition_tid, typeinfo); +} + +static HRESULT WINAPI MediaPositionPassThru_GetIDsOfNames(IMediaPosition *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_Invoke(IMediaPosition *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_get_Duration(IMediaPosition *iface, REFTIME *plength) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", plength); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_get_Duration(pos, plength); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_put_CurrentPosition(IMediaPosition *iface, REFTIME llTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("iface %p, time %.16e.\n", iface, llTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_put_CurrentPosition(pos, llTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_get_CurrentPosition(IMediaPosition *iface, REFTIME *pllTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pllTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_get_CurrentPosition(pos, pllTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_get_StopTime(IMediaPosition *iface, REFTIME *pllTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pllTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_get_StopTime(pos, pllTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_put_StopTime(IMediaPosition *iface, REFTIME llTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("iface %p, time %.16e.\n", iface, llTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_put_StopTime(pos, llTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_get_PrerollTime(IMediaPosition *iface, REFTIME *pllTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pllTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_get_PrerollTime(pos, pllTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_put_PrerollTime(IMediaPosition *iface, REFTIME llTime) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("iface %p, time %.16e.\n", iface, llTime); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_put_PrerollTime(pos, llTime); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_put_Rate(IMediaPosition *iface, double dRate) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%f)\n", dRate); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_put_Rate(pos, dRate); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_get_Rate(IMediaPosition *iface, double *pdRate) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pdRate); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_get_Rate(pos, pdRate); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_CanSeekForward(IMediaPosition *iface, LONG *pCanSeekForward) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pCanSeekForward); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_CanSeekForward(pos, pCanSeekForward); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static HRESULT WINAPI MediaPositionPassThru_CanSeekBackward(IMediaPosition *iface, LONG *pCanSeekBackward) +{ + struct strmbase_passthrough *This = impl_from_IMediaPosition(iface); + IMediaPosition *pos; + HRESULT hr; + + TRACE("(%p)\n", pCanSeekBackward); + + hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos); + if (SUCCEEDED(hr)) { + hr = IMediaPosition_CanSeekBackward(pos, pCanSeekBackward); + IMediaPosition_Release(pos); + } + else + return E_NOTIMPL; + return hr; +} + +static const IMediaPositionVtbl IMediaPositionPassThru_Vtbl = +{ + MediaPositionPassThru_QueryInterface, + MediaPositionPassThru_AddRef, + MediaPositionPassThru_Release, + MediaPositionPassThru_GetTypeInfoCount, + MediaPositionPassThru_GetTypeInfo, + MediaPositionPassThru_GetIDsOfNames, + MediaPositionPassThru_Invoke, + MediaPositionPassThru_get_Duration, + MediaPositionPassThru_put_CurrentPosition, + MediaPositionPassThru_get_CurrentPosition, + MediaPositionPassThru_get_StopTime, + MediaPositionPassThru_put_StopTime, + MediaPositionPassThru_get_PrerollTime, + MediaPositionPassThru_put_PrerollTime, + MediaPositionPassThru_put_Rate, + MediaPositionPassThru_get_Rate, + MediaPositionPassThru_CanSeekForward, + MediaPositionPassThru_CanSeekBackward +}; + +void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer) +{ + memset(passthrough, 0, sizeof(*passthrough)); + + passthrough->outer_unk = outer; + passthrough->IMediaPosition_iface.lpVtbl = &IMediaPositionPassThru_Vtbl; + passthrough->IMediaSeeking_iface.lpVtbl = &IMediaSeekingPassThru_Vtbl; + passthrough->ISeekingPassThru_iface.lpVtbl = &ISeekingPassThru_Vtbl; + InitializeCriticalSection(&passthrough->time_cs); + passthrough->time_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_passthrough.time_cs" ); +} + +void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough) +{ + passthrough->time_cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&passthrough->time_cs); +} + +void strmbase_passthrough_update_time(struct strmbase_passthrough *passthrough, REFERENCE_TIME time) +{ + EnterCriticalSection(&passthrough->time_cs); + passthrough->time_earliest = time; + passthrough->timevalid = TRUE; + LeaveCriticalSection(&passthrough->time_cs); +} + +void strmbase_passthrough_invalidate_time(struct strmbase_passthrough *passthrough) +{ + EnterCriticalSection(&passthrough->time_cs); + passthrough->timevalid = FALSE; + LeaveCriticalSection(&passthrough->time_cs); +} + +void strmbase_passthrough_eos(struct strmbase_passthrough *passthrough) +{ + REFERENCE_TIME time; + HRESULT hr; + + hr = IMediaSeeking_GetStopPosition(&passthrough->IMediaSeeking_iface, &time); + EnterCriticalSection(&passthrough->time_cs); + if (SUCCEEDED(hr)) + { + passthrough->timevalid = TRUE; + passthrough->time_earliest = time; + } + else + passthrough->timevalid = FALSE; + LeaveCriticalSection(&passthrough->time_cs); +} diff --git a/wrappers/new-dlls/strmbase/qualitycontrol.c b/wrappers/new-dlls/strmbase/qualitycontrol.c new file mode 100644 index 00000000000..d0bd070d447 --- /dev/null +++ b/wrappers/new-dlls/strmbase/qualitycontrol.c @@ -0,0 +1,317 @@ +/* + * Quality Control Interfaces + * + * Copyright 2010 Maarten Lankhorst for CodeWeavers + * + * rendering qos functions based on, the original can be found at + * gstreamer/libs/gst/base/gstbasesink.c which has copyright notice: + * + * Copyright (C) 2005-2007 Wim Taymans + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase_qc); + +static inline struct strmbase_qc *impl_from_IQualityControl(IQualityControl *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_qc, IQualityControl_iface); +} + +static HRESULT WINAPI quality_control_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) +{ + struct strmbase_qc *This = impl_from_IQualityControl(iface); + return IBaseFilter_QueryInterface(&This->pin->filter->IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI quality_control_AddRef(IQualityControl *iface) +{ + struct strmbase_qc *This = impl_from_IQualityControl(iface); + return IBaseFilter_AddRef(&This->pin->filter->IBaseFilter_iface); +} + +static ULONG WINAPI quality_control_Release(IQualityControl *iface) +{ + struct strmbase_qc *This = impl_from_IQualityControl(iface); + return IBaseFilter_Release(&This->pin->filter->IBaseFilter_iface); +} + +static HRESULT WINAPI quality_control_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) +{ + struct strmbase_qc *This = impl_from_IQualityControl(iface); + HRESULT hr = S_FALSE; + + TRACE("iface %p, sender %p, type %#x, proportion %u, late %s, timestamp %s.\n", + iface, sender, qm.Type, qm.Proportion, debugstr_time(qm.Late), debugstr_time(qm.TimeStamp)); + + if (This->tonotify) + return IQualityControl_Notify(This->tonotify, &This->pin->filter->IBaseFilter_iface, qm); + + if (This->pin->peer) + { + IQualityControl *qc = NULL; + IPin_QueryInterface(This->pin->peer, &IID_IQualityControl, (void **)&qc); + if (qc) + { + hr = IQualityControl_Notify(qc, &This->pin->filter->IBaseFilter_iface, qm); + IQualityControl_Release(qc); + } + } + + return hr; +} + +static HRESULT WINAPI quality_control_SetSink(IQualityControl *iface, IQualityControl *tonotify) +{ + struct strmbase_qc *This = impl_from_IQualityControl(iface); + TRACE("%p %p\n", This, tonotify); + This->tonotify = tonotify; + return S_OK; +} + +static const IQualityControlVtbl quality_control_vtbl = +{ + quality_control_QueryInterface, + quality_control_AddRef, + quality_control_Release, + quality_control_Notify, + quality_control_SetSink, +}; + +/* Macros copied from gstreamer, weighted average between old average and new ones */ +#define DO_RUNNING_AVG(avg,val,size) (((val) + ((size)-1) * (avg)) / (size)) + +/* generic running average, this has a neutral window size */ +#define UPDATE_RUNNING_AVG(avg,val) DO_RUNNING_AVG(avg,val,8) + +/* the windows for these running averages are experimentally obtained. + * positive values get averaged more while negative values use a small + * window so we can react faster to badness. */ +#define UPDATE_RUNNING_AVG_P(avg,val) DO_RUNNING_AVG(avg,val,16) +#define UPDATE_RUNNING_AVG_N(avg,val) DO_RUNNING_AVG(avg,val,4) + +void QualityControlRender_Start(struct strmbase_qc *This, REFERENCE_TIME tStart) +{ + This->avg_render = This->last_in_time = This->last_left = This->avg_duration = This->avg_pt = -1; + This->clockstart = tStart; + This->avg_rate = -1.0; + This->rendered = This->dropped = 0; + This->is_dropped = FALSE; + This->qos_handled = TRUE; /* Lie that will be corrected on first adjustment */ +} + +static BOOL QualityControlRender_IsLate(struct strmbase_qc *This, REFERENCE_TIME jitter, + REFERENCE_TIME start, REFERENCE_TIME stop) +{ + REFERENCE_TIME max_lateness = 200000; + + TRACE("jitter %s, start %s, stop %s.\n", debugstr_time(jitter), + debugstr_time(start), debugstr_time(stop)); + + /* we can add a valid stop time */ + if (stop >= start) + max_lateness += stop; + else + max_lateness += start; + + /* if the jitter bigger than duration and lateness we are too late */ + if (start + jitter > max_lateness) { + WARN("buffer is too late %i > %i\n", (int)((start + jitter)/10000), (int)(max_lateness/10000)); + /* !!emergency!!, if we did not receive anything valid for more than a + * second, render it anyway so the user sees something */ + if (This->last_in_time < 0 || + start - This->last_in_time < 10000000) + return TRUE; + FIXME("A lot of buffers are being dropped.\n"); + FIXME("There may be a timestamping problem, or this computer is too slow.\n"); + } + This->last_in_time = start; + return FALSE; +} + +void QualityControlRender_DoQOS(struct strmbase_qc *priv) +{ + REFERENCE_TIME start, stop, jitter, pt, entered, left, duration; + double rate; + + TRACE("%p\n", priv); + + if (!priv->pin->filter->clock || priv->current_rstart < 0) + return; + + start = priv->current_rstart; + stop = priv->current_rstop; + jitter = priv->current_jitter; + + if (jitter < 0) { + /* this is the time the buffer entered the sink */ + if (start < -jitter) + entered = 0; + else + entered = start + jitter; + left = start; + } else { + /* this is the time the buffer entered the sink */ + entered = start + jitter; + /* this is the time the buffer left the sink */ + left = start + jitter; + } + + /* calculate duration of the buffer */ + if (stop >= start) + duration = stop - start; + else + duration = 0; + + /* if we have the time when the last buffer left us, calculate + * processing time */ + if (priv->last_left >= 0) { + if (entered > priv->last_left) { + pt = entered - priv->last_left; + } else { + pt = 0; + } + } else { + pt = priv->avg_pt; + } + + TRACE("start %s, entered %s, left %s, pt %s, duration %s, jitter %s.\n", + debugstr_time(start), debugstr_time(entered), debugstr_time(left), + debugstr_time(pt), debugstr_time(duration), debugstr_time(jitter)); + + TRACE("average duration %s, average pt %s, average rate %.16e.\n", + debugstr_time(priv->avg_duration), debugstr_time(priv->avg_pt), priv->avg_rate); + + /* collect running averages. for first observations, we copy the + * values */ + if (priv->avg_duration < 0) + priv->avg_duration = duration; + else + priv->avg_duration = UPDATE_RUNNING_AVG (priv->avg_duration, duration); + + if (priv->avg_pt < 0) + priv->avg_pt = pt; + else + priv->avg_pt = UPDATE_RUNNING_AVG (priv->avg_pt, pt); + + if (priv->avg_duration != 0) + rate = + (double)priv->avg_pt / + (double)priv->avg_duration; + else + rate = 0.0; + + if (priv->last_left >= 0) { + if (priv->is_dropped || priv->avg_rate < 0.0) { + priv->avg_rate = rate; + } else { + if (rate > 1.0) + priv->avg_rate = UPDATE_RUNNING_AVG_N (priv->avg_rate, rate); + else + priv->avg_rate = UPDATE_RUNNING_AVG_P (priv->avg_rate, rate); + } + } + + if (priv->avg_rate >= 0.0) { + HRESULT hr; + Quality q; + /* if we have a valid rate, start sending QoS messages */ + if (priv->current_jitter < 0) { + /* make sure we never go below 0 when adding the jitter to the + * timestamp. */ + if (priv->current_rstart < -priv->current_jitter) + priv->current_jitter = -priv->current_rstart; + } + else + priv->current_jitter += (priv->current_rstop - priv->current_rstart); + q.Type = (jitter > 0 ? Famine : Flood); + q.Proportion = (LONG)(1000. / priv->avg_rate); + if (q.Proportion < 200) + q.Proportion = 200; + else if (q.Proportion > 5000) + q.Proportion = 5000; + q.Late = priv->current_jitter; + q.TimeStamp = priv->current_rstart; + TRACE("Late: %s from %s, rate: %g\n", debugstr_time(q.Late), debugstr_time(q.TimeStamp), 1./priv->avg_rate); + hr = IQualityControl_Notify(&priv->IQualityControl_iface, &priv->pin->filter->IBaseFilter_iface, q); + priv->qos_handled = hr == S_OK; + } + + /* record when this buffer will leave us */ + priv->last_left = left; +} + + +void QualityControlRender_BeginRender(struct strmbase_qc *This, REFERENCE_TIME start, REFERENCE_TIME stop) +{ + This->start = -1; + + This->current_rstart = start; + This->current_rstop = max(stop, start); + + if (start >= 0) + { + REFERENCE_TIME now; + IReferenceClock_GetTime(This->pin->filter->clock, &now); + This->current_jitter = (now - This->clockstart) - start; + } + else + This->current_jitter = 0; + + /* FIXME: This isn't correct; we don't drop samples, nor should. */ + This->is_dropped = QualityControlRender_IsLate(This, This->current_jitter, start, stop); + TRACE("dropped %d, start %s, stop %s, jitter %s.\n", This->is_dropped, + debugstr_time(start), debugstr_time(stop), debugstr_time(This->current_jitter)); + if (This->is_dropped) + This->dropped++; + else + This->rendered++; + + if (!This->pin->filter->clock) + return; + + IReferenceClock_GetTime(This->pin->filter->clock, &This->start); + + TRACE("Starting at %s.\n", debugstr_time(This->start)); +} + +void QualityControlRender_EndRender(struct strmbase_qc *This) +{ + REFERENCE_TIME elapsed; + + TRACE("%p\n", This); + + if (!This->pin->filter->clock || This->start < 0 + || FAILED(IReferenceClock_GetTime(This->pin->filter->clock, &This->stop))) + return; + + elapsed = This->start - This->stop; + if (elapsed < 0) + return; + if (This->avg_render < 0) + This->avg_render = elapsed; + else + This->avg_render = UPDATE_RUNNING_AVG (This->avg_render, elapsed); +} + +void strmbase_qc_init(struct strmbase_qc *qc, struct strmbase_pin *pin) +{ + memset(qc, 0, sizeof(*qc)); + qc->pin = pin; + qc->current_rstart = qc->current_rstop = -1; + qc->IQualityControl_iface.lpVtbl = &quality_control_vtbl; +} diff --git a/wrappers/new-dlls/strmbase/renderer.c b/wrappers/new-dlls/strmbase/renderer.c new file mode 100644 index 00000000000..8da3d81de61 --- /dev/null +++ b/wrappers/new-dlls/strmbase/renderer.c @@ -0,0 +1,353 @@ +/* + * Generic Implementation of strmbase Base Renderer classes + * + * Copyright 2012 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static inline struct strmbase_renderer *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_renderer, filter); +} + +static inline struct strmbase_renderer *impl_from_IPin(IPin *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface); +} + +static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + if (index == 0) + return &filter->sink.pin; + return NULL; +} + +static void renderer_destroy(struct strmbase_filter *iface) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + filter->pFuncsTable->renderer_destroy(filter); +} + +static HRESULT renderer_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + HRESULT hr; + + if (filter->pFuncsTable->renderer_query_interface + && SUCCEEDED(hr = filter->pFuncsTable->renderer_query_interface(filter, iid, out))) + { + return hr; + } + + if (IsEqualGUID(iid, &IID_IMediaPosition)) + *out = &filter->passthrough.IMediaPosition_iface; + else if (IsEqualGUID(iid, &IID_IMediaSeeking)) + *out = &filter->passthrough.IMediaSeeking_iface; + else if (IsEqualGUID(iid, &IID_IQualityControl)) + *out = &filter->qc.IQualityControl_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static HRESULT renderer_init_stream(struct strmbase_filter *iface) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + if (filter->sink.pin.peer) + ResetEvent(filter->state_event); + filter->eos = FALSE; + ResetEvent(filter->flush_event); + if (filter->pFuncsTable->renderer_init_stream) + filter->pFuncsTable->renderer_init_stream(filter); + + return filter->sink.pin.peer ? S_FALSE : S_OK; +} + +static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TIME start) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + filter->stream_start = start; + SetEvent(filter->state_event); + if (filter->sink.pin.peer) + filter->eos = FALSE; + QualityControlRender_Start(&filter->qc, filter->stream_start); + if (filter->sink.pin.peer && filter->pFuncsTable->renderer_start_stream) + filter->pFuncsTable->renderer_start_stream(filter); + + return S_OK; +} + +static HRESULT renderer_stop_stream(struct strmbase_filter *iface) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + if (filter->sink.pin.peer && filter->pFuncsTable->renderer_stop_stream) + filter->pFuncsTable->renderer_stop_stream(filter); + + return S_OK; +} + +static HRESULT renderer_cleanup_stream(struct strmbase_filter *iface) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + strmbase_passthrough_invalidate_time(&filter->passthrough); + SetEvent(filter->state_event); + SetEvent(filter->flush_event); + + return S_OK; +} + +static HRESULT renderer_wait_state(struct strmbase_filter *iface, DWORD timeout) +{ + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); + + if (WaitForSingleObject(filter->state_event, timeout) == WAIT_TIMEOUT) + return VFW_S_STATE_INTERMEDIATE; + return S_OK; +} + +static const struct strmbase_filter_ops filter_ops = +{ + .filter_get_pin = renderer_get_pin, + .filter_destroy = renderer_destroy, + .filter_query_interface = renderer_query_interface, + .filter_init_stream = renderer_init_stream, + .filter_start_stream = renderer_start_stream, + .filter_stop_stream = renderer_stop_stream, + .filter_cleanup_stream = renderer_cleanup_stream, + .filter_wait_state = renderer_wait_state, +}; + +static HRESULT sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_renderer *filter = impl_from_IPin(&pin->IPin_iface); + return filter->pFuncsTable->pfnCheckMediaType(filter, mt); +} + +static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->IPin_iface); + HRESULT hr; + + if (filter->pFuncsTable->renderer_pin_query_interface + && SUCCEEDED(hr = filter->pFuncsTable->renderer_pin_query_interface(filter, iid, out))) + return hr; + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSample *sample) +{ + struct strmbase_renderer *filter = impl_from_IPin(&pin->pin.IPin_iface); + REFERENCE_TIME start, stop; + BOOL need_wait = FALSE; + FILTER_STATE state; + HRESULT hr = S_OK; + AM_MEDIA_TYPE *mt; + + if (filter->eos || filter->sink.flushing) + return S_FALSE; + + state = filter->filter.state; + if (state == State_Stopped) + return VFW_E_WRONG_STATE; + + if (IMediaSample_GetMediaType(sample, &mt) == S_OK) + { + TRACE("Format change.\n"); + strmbase_dump_media_type(mt); + + if (FAILED(filter->pFuncsTable->pfnCheckMediaType(filter, mt))) + return VFW_E_TYPE_NOT_ACCEPTED; + DeleteMediaType(mt); + } + + if (filter->filter.clock && SUCCEEDED(IMediaSample_GetTime(sample, &start, &stop))) + { + strmbase_passthrough_update_time(&filter->passthrough, start); + need_wait = TRUE; + } + else + start = stop = -1; + + if (state == State_Paused) + { + QualityControlRender_BeginRender(&filter->qc, start, stop); + hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample); + QualityControlRender_EndRender(&filter->qc); + } + + if (need_wait) + { + REFERENCE_TIME now; + DWORD_PTR cookie; + + IReferenceClock_GetTime(filter->filter.clock, &now); + + if (now - filter->stream_start - start <= -10000) + { + HANDLE handles[2] = {filter->advise_event, filter->flush_event}; + DWORD ret; + + IReferenceClock_AdviseTime(filter->filter.clock, filter->stream_start, + start, (HEVENT)filter->advise_event, &cookie); + + ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE); + IReferenceClock_Unadvise(filter->filter.clock, cookie); + + if (ret == 1) + { + TRACE("Flush signaled; discarding current sample.\n"); + return S_OK; + } + } + } + + if (state == State_Running) + { + QualityControlRender_BeginRender(&filter->qc, start, stop); + hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample); + QualityControlRender_EndRender(&filter->qc); + } + + QualityControlRender_DoQOS(&filter->qc); + + return hr; +} + +static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); + + if (filter->pFuncsTable->renderer_connect) + return filter->pFuncsTable->renderer_connect(filter, mt); + return S_OK; +} + +static void sink_disconnect(struct strmbase_sink *iface) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); + + if (filter->pFuncsTable->pfnBreakConnect) + filter->pFuncsTable->pfnBreakConnect(filter); +} + +static HRESULT sink_eos(struct strmbase_sink *iface) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); + IFilterGraph *graph = filter->filter.graph; + IMediaEventSink *event_sink; + + filter->eos = TRUE; + + if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph, + &IID_IMediaEventSink, (void **)&event_sink))) + { + IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK, + (LONG_PTR)&filter->filter.IBaseFilter_iface); + IMediaEventSink_Release(event_sink); + } + strmbase_passthrough_eos(&filter->passthrough); + SetEvent(filter->state_event); + + return S_OK; +} + +static HRESULT sink_begin_flush(struct strmbase_sink *iface) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); + + SetEvent(filter->flush_event); + + return S_OK; +} + +static HRESULT sink_end_flush(struct strmbase_sink *iface) +{ + struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); + + EnterCriticalSection(&filter->filter.stream_cs); + + filter->eos = FALSE; + QualityControlRender_Start(&filter->qc, filter->stream_start); + strmbase_passthrough_invalidate_time(&filter->passthrough); + ResetEvent(filter->flush_event); + + LeaveCriticalSection(&filter->filter.stream_cs); + return S_OK; +} + +static const struct strmbase_sink_ops sink_ops = +{ + .base.pin_query_accept = sink_query_accept, + .base.pin_query_interface = sink_query_interface, + .pfnReceive = BaseRenderer_Receive, + .sink_connect = sink_connect, + .sink_disconnect = sink_disconnect, + .sink_eos = sink_eos, + .sink_begin_flush = sink_begin_flush, + .sink_end_flush = sink_end_flush, +}; + +void strmbase_renderer_cleanup(struct strmbase_renderer *filter) +{ + if (filter->sink.pin.peer) + IPin_Disconnect(filter->sink.pin.peer); + IPin_Disconnect(&filter->sink.pin.IPin_iface); + strmbase_sink_cleanup(&filter->sink); + + strmbase_passthrough_cleanup(&filter->passthrough); + + CloseHandle(filter->state_event); + CloseHandle(filter->advise_event); + CloseHandle(filter->flush_event); + strmbase_filter_cleanup(&filter->filter); +} + +void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, + const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops) +{ + memset(filter, 0, sizeof(*filter)); + strmbase_filter_init(&filter->filter, outer, clsid, &filter_ops); + strmbase_passthrough_init(&filter->passthrough, (IUnknown *)&filter->filter.IBaseFilter_iface); + ISeekingPassThru_Init(&filter->passthrough.ISeekingPassThru_iface, TRUE, &filter->sink.pin.IPin_iface); + strmbase_qc_init(&filter->qc, &filter->sink.pin); + + filter->pFuncsTable = ops; + + strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL); + + filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); + filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); +} diff --git a/wrappers/new-dlls/strmbase/seeking.c b/wrappers/new-dlls/strmbase/seeking.c new file mode 100644 index 00000000000..d87e4f8516c --- /dev/null +++ b/wrappers/new-dlls/strmbase/seeking.c @@ -0,0 +1,324 @@ +/* + * Filter Seeking and Control Interfaces + * + * Copyright 2003 Robert Shearman + * Copyright 2010 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "strmbase_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static inline SourceSeeking *impl_from_IMediaSeeking(IMediaSeeking *iface) +{ + return CONTAINING_RECORD(iface, SourceSeeking, IMediaSeeking_iface); +} + +HRESULT strmbase_seeking_init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *Vtbl, + SourceSeeking_ChangeStop fnChangeStop, SourceSeeking_ChangeStart fnChangeStart, + SourceSeeking_ChangeRate fnChangeRate) +{ + assert(fnChangeStop && fnChangeStart && fnChangeRate); + + pSeeking->IMediaSeeking_iface.lpVtbl = Vtbl; + pSeeking->refCount = 1; + pSeeking->fnChangeRate = fnChangeRate; + pSeeking->fnChangeStop = fnChangeStop; + pSeeking->fnChangeStart = fnChangeStart; + pSeeking->dwCapabilities = AM_SEEKING_CanSeekForwards | + AM_SEEKING_CanSeekBackwards | + AM_SEEKING_CanSeekAbsolute | + AM_SEEKING_CanGetStopPos | + AM_SEEKING_CanGetDuration; + pSeeking->llCurrent = 0; + pSeeking->llStop = ((ULONGLONG)0x80000000) << 32; + pSeeking->llDuration = pSeeking->llStop; + pSeeking->dRate = 1.0; + pSeeking->timeformat = TIME_FORMAT_MEDIA_TIME; + InitializeCriticalSection(&pSeeking->cs); + pSeeking->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SourceSeeking.cs"); + return S_OK; +} + +void strmbase_seeking_cleanup(SourceSeeking *seeking) +{ + DeleteCriticalSection(&seeking->cs); +} + +HRESULT WINAPI SourceSeekingImpl_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p)\n", pCapabilities); + + *pCapabilities = This->dwCapabilities; + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + HRESULT hr; + DWORD dwCommonCaps; + + TRACE("(%p)\n", pCapabilities); + + if (!pCapabilities) + return E_POINTER; + + dwCommonCaps = *pCapabilities & This->dwCapabilities; + + if (!dwCommonCaps) + hr = E_FAIL; + else + hr = (*pCapabilities == dwCommonCaps) ? S_OK : S_FALSE; + *pCapabilities = dwCommonCaps; + return hr; +} + +HRESULT WINAPI SourceSeekingImpl_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat) +{ + TRACE("(%s)\n", debugstr_guid(pFormat)); + + return (IsEqualIID(pFormat, &TIME_FORMAT_MEDIA_TIME) ? S_OK : S_FALSE); +} + +HRESULT WINAPI SourceSeekingImpl_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat) +{ + TRACE("(%s)\n", debugstr_guid(pFormat)); + + *pFormat = TIME_FORMAT_MEDIA_TIME; + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + TRACE("(%s)\n", debugstr_guid(pFormat)); + + EnterCriticalSection(&This->cs); + *pFormat = This->timeformat; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + HRESULT hr = S_OK; + + TRACE("(%s)\n", debugstr_guid(pFormat)); + + EnterCriticalSection(&This->cs); + if (!IsEqualIID(pFormat, &This->timeformat)) + hr = S_FALSE; + LeaveCriticalSection(&This->cs); + + return hr; +} + +HRESULT WINAPI SourceSeekingImpl_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + TRACE("%p %s\n", This, debugstr_guid(pFormat)); + return (IsEqualIID(pFormat, &TIME_FORMAT_MEDIA_TIME) ? S_OK : E_INVALIDARG); +} + + +HRESULT WINAPI SourceSeekingImpl_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p)\n", pDuration); + + EnterCriticalSection(&This->cs); + *pDuration = This->llDuration; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p)\n", pStop); + + EnterCriticalSection(&This->cs); + *pStop = This->llStop; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +/* FIXME: Make use of the info the filter should expose */ +HRESULT WINAPI SourceSeekingImpl_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p)\n", pCurrent); + + EnterCriticalSection(&This->cs); + *pCurrent = This->llCurrent; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + if (!pTargetFormat) + pTargetFormat = &This->timeformat; + if (!pSourceFormat) + pSourceFormat = &This->timeformat; + if (IsEqualIID(pTargetFormat, &TIME_FORMAT_MEDIA_TIME) && IsEqualIID(pSourceFormat, &TIME_FORMAT_MEDIA_TIME)) + { + *pTarget = Source; + return S_OK; + } + /* FIXME: clear pTarget? */ + return E_INVALIDARG; +} + +static inline LONGLONG Adjust(LONGLONG value, const LONGLONG * pModifier, DWORD dwFlags) +{ + switch (dwFlags & AM_SEEKING_PositioningBitsMask) + { + case AM_SEEKING_NoPositioning: + return value; + case AM_SEEKING_AbsolutePositioning: + return *pModifier; + case AM_SEEKING_RelativePositioning: + case AM_SEEKING_IncrementalPositioning: + return value + *pModifier; + default: + assert(FALSE); + return 0; + } +} + +HRESULT WINAPI SourceSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + BOOL bChangeCurrent = FALSE, bChangeStop = FALSE; + LONGLONG llNewCurrent, llNewStop; + + TRACE("(%p, %x, %p, %x)\n", pCurrent, dwCurrentFlags, pStop, dwStopFlags); + EnterCriticalSection(&This->cs); + + llNewCurrent = Adjust(This->llCurrent, pCurrent, dwCurrentFlags); + llNewStop = Adjust(This->llStop, pStop, dwStopFlags); + + if (pCurrent) + bChangeCurrent = TRUE; + if (llNewStop != This->llStop) + bChangeStop = TRUE; + + TRACE("Old: %u, New: %u\n", (DWORD)(This->llCurrent/10000000), (DWORD)(llNewCurrent/10000000)); + + This->llCurrent = llNewCurrent; + This->llStop = llNewStop; + + if (pCurrent && (dwCurrentFlags & AM_SEEKING_ReturnTime)) + *pCurrent = llNewCurrent; + if (pStop && (dwStopFlags & AM_SEEKING_ReturnTime)) + *pStop = llNewStop; + LeaveCriticalSection(&This->cs); + + if (bChangeCurrent) + This->fnChangeStart(iface); + if (bChangeStop) + This->fnChangeStop(iface); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p, %p)\n", pCurrent, pStop); + + EnterCriticalSection(&This->cs); + IMediaSeeking_GetCurrentPosition(iface, pCurrent); + IMediaSeeking_GetStopPosition(iface, pStop); + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p, %p)\n", pEarliest, pLatest); + + EnterCriticalSection(&This->cs); + *pEarliest = 0; + *pLatest = This->llDuration; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_SetRate(IMediaSeeking * iface, double dRate) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + BOOL bChangeRate = (dRate != This->dRate); + HRESULT hr = S_OK; + + TRACE("(%e)\n", dRate); + + if (dRate > 100 || dRate < .001) + { + FIXME("Excessive rate %e, ignoring\n", dRate); + return VFW_E_UNSUPPORTED_AUDIO; + } + + EnterCriticalSection(&This->cs); + This->dRate = dRate; + if (bChangeRate) + hr = This->fnChangeRate(iface); + LeaveCriticalSection(&This->cs); + + return hr; +} + +HRESULT WINAPI SourceSeekingImpl_GetRate(IMediaSeeking * iface, double * dRate) +{ + SourceSeeking *This = impl_from_IMediaSeeking(iface); + + TRACE("(%p)\n", dRate); + + EnterCriticalSection(&This->cs); + /* Forward? */ + *dRate = This->dRate; + LeaveCriticalSection(&This->cs); + + return S_OK; +} + +HRESULT WINAPI SourceSeekingImpl_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll) +{ + TRACE("(%p)\n", pPreroll); + + *pPreroll = 0; + return S_OK; +} diff --git a/wrappers/new-dlls/strmbase/strmbase_private.h b/wrappers/new-dlls/strmbase/strmbase_private.h new file mode 100644 index 00000000000..ff82d942813 --- /dev/null +++ b/wrappers/new-dlls/strmbase/strmbase_private.h @@ -0,0 +1,61 @@ +/* + * Header file for private strmbase implementations + * + * Copyright 2012 Aric Stewart, CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_STRMBASE_PRIVATE_H +#define __WINE_STRMBASE_PRIVATE_H + +#include +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#define COBJMACROS +#include "dshow.h" +#include "uuids.h" +#include "wine/debug.h" +#include "wine/heap.h" +#include "wine/list.h" +#include "wine/strmbase.h" + +static inline const char *debugstr_time(REFERENCE_TIME time) +{ + ULONGLONG abstime = time >= 0 ? time : -time; + unsigned int i = 0, j = 0; + char buffer[23], rev[23]; + + while (abstime || i <= 8) + { + buffer[i++] = '0' + (abstime % 10); + abstime /= 10; + if (i == 7) buffer[i++] = '.'; + } + if (time < 0) buffer[i++] = '-'; + + while (i--) rev[j++] = buffer[i]; + while (rev[j-1] == '0' && rev[j-2] != '.') --j; + rev[j] = 0; + + return wine_dbg_sprintf("%s", rev); +} + +void QualityControlRender_Start(struct strmbase_qc *This, REFERENCE_TIME tStart); +void QualityControlRender_DoQOS(struct strmbase_qc *priv); +void QualityControlRender_BeginRender(struct strmbase_qc *This, REFERENCE_TIME start, REFERENCE_TIME stop); +void QualityControlRender_EndRender(struct strmbase_qc *This); + +#endif /* __WINE_STRMBASE_PRIVATE_H */ diff --git a/wrappers/new-dlls/strmiids/Makefile.in b/wrappers/new-dlls/strmiids/Makefile.in new file mode 100644 index 00000000000..09edc7018fc --- /dev/null +++ b/wrappers/new-dlls/strmiids/Makefile.in @@ -0,0 +1,5 @@ +MODULE = libstrmiids.a + +C_SRCS = \ + evr.c \ + strmiids.c diff --git a/wrappers/new-dlls/strmiids/evr.c b/wrappers/new-dlls/strmiids/evr.c new file mode 100644 index 00000000000..74ec145e4d4 --- /dev/null +++ b/wrappers/new-dlls/strmiids/evr.c @@ -0,0 +1,25 @@ +/* + * Copyright 2017 Fabian Maurer + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Don't define those GUIDs here */ +#include "propidl.h" +#include "mfidl.h" + +#include "initguid.h" + +#include "evr.h" diff --git a/wrappers/new-dlls/strmiids/strmiids.c b/wrappers/new-dlls/strmiids/strmiids.c new file mode 100644 index 00000000000..a257a23e9a4 --- /dev/null +++ b/wrappers/new-dlls/strmiids/strmiids.c @@ -0,0 +1,41 @@ +/* + * GUID definitions + * + * Copyright 2000 Alexandre Julliard + * Copyright 2000 Francois Gouget + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" + +#include "objbase.h" +#include "oleauto.h" +#include "olectl.h" +#include "d3d9.h" + +#include "initguid.h" + +#include "uuids.h" +#include "strmif.h" +#include "control.h" +#include "amstream.h" +#include "qedit.h" +#include "vmr9.h" diff --git a/wrappers/new-dlls/svrapi/Makefile.in b/wrappers/new-dlls/svrapi/Makefile.in new file mode 100644 index 00000000000..c9467f28d97 --- /dev/null +++ b/wrappers/new-dlls/svrapi/Makefile.in @@ -0,0 +1,6 @@ +MODULE = svrapi.dll + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + svrapi_main.c diff --git a/wrappers/new-dlls/svrapi/svrapi.spec b/wrappers/new-dlls/svrapi/svrapi.spec new file mode 100644 index 00000000000..c8a25accb79 --- /dev/null +++ b/wrappers/new-dlls/svrapi/svrapi.spec @@ -0,0 +1,20 @@ +@ stub NetAccessAdd +@ stub NetAccessCheck +@ stub NetAccessDel +@ stub NetAccessEnum +@ stub NetAccessGetInfo +@ stub NetAccessGetUserPerms +@ stub NetAccessSetInfo +@ stub NetConnectionEnum +@ stub NetFileClose +@ stub NetFileEnum +@ stub NetSecurityGetInfo +@ stub NetServerGetInfo +@ stub NetSessionDel +@ stub NetSessionEnum +@ stub NetSessionGetInfo +@ stub NetShareAdd +@ stub NetShareDel +@ stub NetShareEnum +@ stub NetShareGetInfo +@ stub NetShareSetInfo diff --git a/wrappers/new-dlls/svrapi/svrapi_main.c b/wrappers/new-dlls/svrapi/svrapi_main.c new file mode 100644 index 00000000000..8c7b007fc5a --- /dev/null +++ b/wrappers/new-dlls/svrapi/svrapi_main.c @@ -0,0 +1,46 @@ +/* +* Part of NETAPI on Windows 9x +* +* Copyright 2006 Konstantin Petrov +* +* 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.1 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, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "svrapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(svrapi); + +/*********************************************************************** + * DllMain (SVRAPI.init) + */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) +{ + TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad); + + switch(fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /*prefer native version*/ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + } + return TRUE; +} diff --git a/wrappers/new-dlls/ucrtbase/Makefile.in b/wrappers/new-dlls/ucrtbase/Makefile.in new file mode 100644 index 00000000000..a576cf0250b --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/Makefile.in @@ -0,0 +1,47 @@ +EXTRADEFS = -D_CRTIMP= +MODULE = ucrtbase.dll +IMPORTLIB = ucrtbase +IMPORTS = ntdll +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + console.c \ + cpp.c \ + crt_gccmain.c \ + crt_main.c \ + crt_winmain.c \ + crt_wmain.c \ + crt_wwinmain.c \ + ctype.c \ + data.c \ + dir.c \ + environ.c \ + errno.c \ + except.c \ + except_arm.c \ + except_arm64.c \ + except_i386.c \ + except_x86_64.c \ + exit.c \ + file.c \ + heap.c \ + locale.c \ + lock.c \ + main.c \ + math.c \ + mathf.c \ + mbcs.c \ + misc.c \ + printf.c \ + process.c \ + scanf.c \ + string.c \ + thread.c \ + time.c \ + undname.c \ + unixlib.c \ + wcs.c + +RC_SRCS = version.rc diff --git a/wrappers/new-dlls/ucrtbase/printf.c b/wrappers/new-dlls/ucrtbase/printf.c new file mode 100644 index 00000000000..6a1e5fdea7d --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/printf.c @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Alexandre Julliard + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* this function is part of the import lib */ +#if 0 +#pragma makedep implib +#endif + +#include +#include + +int __cdecl __stdio_common_vsprintf(unsigned __int64 options, char *str, size_t len, + const char *format, _locale_t locale, __ms_va_list valist); + +int __cdecl _vsnprintf( char *buf, size_t size, const char *fmt, __ms_va_list args ) +{ + return __stdio_common_vsprintf( _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, + buf, size, fmt, NULL, args ); +} diff --git a/wrappers/new-dlls/ucrtbase/tests/Makefile.in b/wrappers/new-dlls/ucrtbase/tests/Makefile.in new file mode 100644 index 00000000000..259880a7d90 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/Makefile.in @@ -0,0 +1,10 @@ +TESTDLL = ucrtbase.dll +IMPORTS = ucrtbase +EXTRADEFS = -fno-builtin + +C_SRCS = \ + cpp.c \ + misc.c \ + printf.c \ + scanf.c \ + string.c diff --git a/wrappers/new-dlls/ucrtbase/tests/cpp.c b/wrappers/new-dlls/ucrtbase/tests/cpp.c new file mode 100644 index 00000000000..163e1968069 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/cpp.c @@ -0,0 +1,197 @@ +/* + * Copyright 2016 Daniel Lehman (Esri) + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include + +#include +#include +#include "wine/test.h" + +typedef unsigned char MSVCRT_bool; + +typedef struct { + const char *what; + MSVCRT_bool dofree; +} __std_exception_data; + +typedef struct +{ + char *name; + char mangled[32]; +} type_info140; + +typedef struct _type_info_list +{ + SLIST_ENTRY entry; + char name[1]; +} type_info_list; + +static void* (CDECL *p_malloc)(size_t); +static void (CDECL *p___std_exception_copy)(const __std_exception_data*, __std_exception_data*); +static void (CDECL *p___std_exception_destroy)(__std_exception_data*); +static int (CDECL *p___std_type_info_compare)(const type_info140*, const type_info140*); +static const char* (CDECL *p___std_type_info_name)(type_info140*, SLIST_HEADER*); +static void (CDECL *p___std_type_info_destroy_list)(SLIST_HEADER*); +static size_t (CDECL *p___std_type_info_hash)(type_info140*); + + +static BOOL init(void) +{ + HMODULE module; + + module = LoadLibraryA("ucrtbase.dll"); + if (!module) + { + win_skip("ucrtbase.dll not installed\n"); + return FALSE; + } + + p_malloc = (void*)GetProcAddress(module, "malloc"); + p___std_exception_copy = (void*)GetProcAddress(module, "__std_exception_copy"); + p___std_exception_destroy = (void*)GetProcAddress(module, "__std_exception_destroy"); + p___std_type_info_compare = (void*)GetProcAddress(module, "__std_type_info_compare"); + p___std_type_info_name = (void*)GetProcAddress(module, "__std_type_info_name"); + p___std_type_info_destroy_list = (void*)GetProcAddress(module, "__std_type_info_destroy_list"); + p___std_type_info_hash = (void*)GetProcAddress(module, "__std_type_info_hash"); + return TRUE; +} + +static void test___std_exception(void) +{ + __std_exception_data src; + __std_exception_data dst; + + if (0) /* crash on Windows */ + { + p___std_exception_copy(NULL, &src); + p___std_exception_copy(&dst, NULL); + + src.what = "invalid free"; + src.dofree = 1; + p___std_exception_destroy(&src); + p___std_exception_destroy(NULL); + } + + src.what = "what"; + src.dofree = 0; + p___std_exception_copy(&src, &dst); + ok(dst.what == src.what, "expected what to be same, got src %p dst %p\n", src.what, dst.what); + ok(!dst.dofree, "expected 0, got %d\n", dst.dofree); + + src.dofree = 0x42; + p___std_exception_copy(&src, &dst); + ok(dst.what != src.what, "expected what to be different, got src %p dst %p\n", src.what, dst.what); + ok(dst.dofree == 1, "expected 1, got %d\n", dst.dofree); + + p___std_exception_destroy(&dst); + ok(!dst.what, "expected NULL, got %p\n", dst.what); + ok(!dst.dofree, "expected 0, got %d\n", dst.dofree); + + src.what = NULL; + src.dofree = 0; + p___std_exception_copy(&src, &dst); + ok(!dst.what, "dst.what != NULL\n"); + ok(!dst.dofree, "dst.dofree != FALSE\n"); + + src.what = NULL; + src.dofree = 1; + p___std_exception_copy(&src, &dst); + ok(!dst.what, "dst.what != NULL\n"); + ok(!dst.dofree, "dst.dofree != FALSE\n"); +} + +static void test___std_type_info(void) +{ + type_info140 ti1 = { NULL, ".?AVa@@" }; + type_info140 ti2 = { NULL, ".?AVb@@" }; + type_info140 ti3 = ti1; + SLIST_HEADER header; + type_info_list *elem; + const char *ret; + size_t hash1, hash2; + int eq; + + + InitializeSListHead(&header); + p___std_type_info_destroy_list(&header); + + elem = p_malloc(sizeof(*elem)); + memset(elem, 0, sizeof(*elem)); + InterlockedPushEntrySList(&header, &elem->entry); + p___std_type_info_destroy_list(&header); + ok(!InterlockedPopEntrySList(&header), "list is not empty\n"); + + ret = p___std_type_info_name(&ti1, &header); + ok(!strcmp(ret, "class a"), "__std_type_info_name(&ti1) = %s\n", ret); + ok(ti1.name == ret, "ti1.name = %p, ret = %p\n", ti1.name, ret); + + p___std_type_info_destroy_list(&header); + ok(!InterlockedPopEntrySList(&header), "list is not empty\n"); + ok(ti1.name == ret, "ti1.name = %p, ret = %p\n", ti1.name, ret); + ti1.name = NULL; + + eq = p___std_type_info_compare(&ti1, &ti1); + ok(eq == 0, "__std_type_info_compare(&ti1, &ti1) = %d\n", eq); + + eq = p___std_type_info_compare(&ti1, &ti2); + ok(eq == -1, "__std_type_info_compare(&ti1, &ti2) = %d\n", eq); + + eq = p___std_type_info_compare(&ti1, &ti3); + ok(eq == 0, "__std_type_info_compare(&ti1, &ti3) = %d\n", eq); + + ti1.mangled[0] = 0; + ti1.mangled[1] = 0; + ti1.mangled[2] = 0; + hash1 = p___std_type_info_hash(&ti1); +#ifdef _WIN64 + ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1); +#else + ok(hash1 == 0x811c9dc5, "hash = %p\n", (void*)hash1); +#endif + + ti1.mangled[0] = 1; + hash2 = p___std_type_info_hash(&ti1); + ok(hash1 == hash2, "hash1 != hash2 (first char not ignored)\n"); + + ti1.mangled[1] = 1; + hash1 = p___std_type_info_hash(&ti1); +#ifdef _WIN64 + ok(hash1 == 0xaf63bc4c29620a60, "hash = %p\n", (void*)hash1); +#else + ok(hash1 == 0x40c5b8c, "hash = %p\n", (void*)hash1); +#endif + ok(hash1 != hash2, "hash1 == hash2 for different strings\n"); + + ti1.mangled[1] = 2; + hash2 = p___std_type_info_hash(&ti1); + ok(hash1 != hash2, "hash1 == hash2 for different strings\n"); + + hash1 = p___std_type_info_hash(&ti2); + ok(hash1 != hash2, "hash1 == hash2 for different strings\n"); +} + +START_TEST(cpp) +{ + if (!init()) return; + test___std_exception(); + test___std_type_info(); +} diff --git a/wrappers/new-dlls/ucrtbase/tests/misc.c b/wrappers/new-dlls/ucrtbase/tests/misc.c new file mode 100644 index 00000000000..5fcec2e2bb5 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/misc.c @@ -0,0 +1,1414 @@ +/* + * Copyright 2016 Nikolay Sivov for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "wine/test.h" + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +static inline double __port_min_pos_double(void) +{ + static const UINT64 __min_pos_double = 0x10000000000000; + return *(const double *)&__min_pos_double; +} + +static inline double __port_max_double(void) +{ + static const UINT64 __max_double = 0x7FEFFFFFFFFFFFFF; + return *(const double *)&__max_double; +} + +DEFINE_EXPECT(global_invalid_parameter_handler); +DEFINE_EXPECT(thread_invalid_parameter_handler); + +typedef struct { + const char *short_wday[7]; + const char *wday[7]; + const char *short_mon[12]; + const char *mon[12]; + const char *am; + const char *pm; + const char *short_date; + const char *date; + const char *time; + int unk; + int refcount; + const wchar_t *short_wdayW[7]; + const wchar_t *wdayW[7]; + const wchar_t *short_monW[12]; + const wchar_t *monW[12]; + const wchar_t *amW; + const wchar_t *pmW; + const wchar_t *short_dateW; + const wchar_t *dateW; + const wchar_t *timeW; + const wchar_t *locnameW; +} __lc_time_data; + +typedef void (__cdecl *_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info); + +static LONGLONG crt_init_end; + +_ACRTIMP int __cdecl _o__initialize_onexit_table(_onexit_table_t *table); +_ACRTIMP int __cdecl _o__register_onexit_function(_onexit_table_t *table, _onexit_t func); +_ACRTIMP int __cdecl _o__execute_onexit_table(_onexit_table_t *table); +_ACRTIMP void *__cdecl _o_malloc(size_t); +_se_translator_function __cdecl _set_se_translator(_se_translator_function func); +void** __cdecl __current_exception(void); +int* __cdecl __processing_throw(void); + +static void test__initialize_onexit_table(void) +{ + _onexit_table_t table, table2; + int ret; + + ret = _initialize_onexit_table(NULL); + ok(ret == -1, "got %d\n", ret); + + memset(&table, 0, sizeof(table)); + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(table._first == table._last && table._first == table._end, "got first %p, last %p, end %p\n", + table._first, table._last, table._end); + + memset(&table2, 0, sizeof(table2)); + ret = _initialize_onexit_table(&table2); + ok(ret == 0, "got %d\n", ret); + ok(table2._first == table._first, "got %p, %p\n", table2._first, table._first); + ok(table2._last == table._last, "got %p, %p\n", table2._last, table._last); + ok(table2._end == table._end, "got %p, %p\n", table2._end, table._end); + + memset(&table2, 0, sizeof(table2)); + ret = _o__initialize_onexit_table(&table2); + ok(ret == 0, "got %d\n", ret); + ok(table2._first == table._first, "got %p, %p\n", table2._first, table._first); + ok(table2._last == table._last, "got %p, %p\n", table2._last, table._last); + ok(table2._end == table._end, "got %p, %p\n", table2._end, table._end); + + /* uninitialized table */ + table._first = table._last = table._end = (void*)0x123; + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(table._first == table._last && table._first == table._end, "got first %p, last %p, end %p\n", + table._first, table._last, table._end); + ok(table._first != (void*)0x123, "got %p\n", table._first); + + table._first = (void*)0x123; + table._last = (void*)0x456; + table._end = (void*)0x123; + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(table._first == table._last && table._first == table._end, "got first %p, last %p, end %p\n", + table._first, table._last, table._end); + ok(table._first != (void*)0x123, "got %p\n", table._first); + + table._first = (void*)0x123; + table._last = (void*)0x456; + table._end = (void*)0x789; + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(table._first == (void*)0x123, "got %p\n", table._first); + ok(table._last == (void*)0x456, "got %p\n", table._last); + ok(table._end == (void*)0x789, "got %p\n", table._end); + + table._first = NULL; + table._last = (void*)0x456; + table._end = NULL; + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(table._first == table._last && table._first == table._end, "got first %p, last %p, end %p\n", + table._first, table._last, table._end); +} + +static int g_onexit_called; +static int CDECL onexit_func(void) +{ + g_onexit_called++; + return 0; +} + +static int CDECL onexit_func2(void) +{ + ok(g_onexit_called == 0, "got %d\n", g_onexit_called); + g_onexit_called++; + return 0; +} + +static void test__register_onexit_function(void) +{ + _onexit_table_t table; + _PVFV *f; + int ret; + + memset(&table, 0, sizeof(table)); + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(NULL, NULL); + ok(ret == -1, "got %d\n", ret); + + ret = _register_onexit_function(NULL, onexit_func); + ok(ret == -1, "got %d\n", ret); + + f = table._last; + ret = _register_onexit_function(&table, NULL); + ok(ret == 0, "got %d\n", ret); + ok(f != table._last, "got %p, initial %p\n", table._last, f); + + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + f = table._last; + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + ok(f != table._last, "got %p, initial %p\n", table._last, f); + + f = table._last; + ret = _o__register_onexit_function(&table, NULL); + ok(ret == 0, "got %d\n", ret); + ok(f != table._last, "got %p, initial %p\n", table._last, f); + + f = table._last; + ret = _o__register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + ok(f != table._last, "got %p, initial %p\n", table._last, f); + + ret = _execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); +} + +static void test__execute_onexit_table(void) +{ + _onexit_table_t table; + int ret; + + ret = _execute_onexit_table(NULL); + ok(ret == -1, "got %d\n", ret); + + memset(&table, 0, sizeof(table)); + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + + /* execute empty table */ + ret = _execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + + /* same function registered multiple times */ + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, NULL); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ret = _o__register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ok(table._first != table._end, "got %p, %p\n", table._first, table._end); + g_onexit_called = 0; + ret = _execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(g_onexit_called == 3, "got %d\n", g_onexit_called); + ok(table._first == table._end, "got %p, %p\n", table._first, table._end); + + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, NULL); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ret = _o__register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ok(table._first != table._end, "got %p, %p\n", table._first, table._end); + g_onexit_called = 0; + ret = _o__execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(g_onexit_called == 3, "got %d\n", g_onexit_called); + ok(table._first == table._end, "got %p, %p\n", table._first, table._end); + + /* execute again, table is already empty */ + g_onexit_called = 0; + ret = _execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(g_onexit_called == 0, "got %d\n", g_onexit_called); + + /* check call order */ + memset(&table, 0, sizeof(table)); + ret = _initialize_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, onexit_func); + ok(ret == 0, "got %d\n", ret); + + ret = _register_onexit_function(&table, onexit_func2); + ok(ret == 0, "got %d\n", ret); + + g_onexit_called = 0; + ret = _execute_onexit_table(&table); + ok(ret == 0, "got %d\n", ret); + ok(g_onexit_called == 2, "got %d\n", g_onexit_called); +} + +static void test___fpe_flt_rounds(void) +{ + unsigned int cfp = _controlfp(0, 0); + int ret; + + if(!cfp) { + skip("_controlfp not supported\n"); + return; + } + + ok((_controlfp(_RC_NEAR, _RC_CHOP) & _RC_CHOP) == _RC_NEAR, "_controlfp(_RC_NEAR, _RC_CHOP) failed\n"); + ret = __fpe_flt_rounds(); + ok(ret == 1, "__fpe_flt_rounds returned %d\n", ret); + + ok((_controlfp(_RC_UP, _RC_CHOP) & _RC_CHOP) == _RC_UP, "_controlfp(_RC_UP, _RC_CHOP) failed\n"); + ret = __fpe_flt_rounds(); + ok(ret == 2 || broken(ret == 3) /* w1064v1507 */, "__fpe_flt_rounds returned %d\n", ret); + + ok((_controlfp(_RC_DOWN, _RC_CHOP) & _RC_CHOP) == _RC_DOWN, "_controlfp(_RC_DOWN, _RC_CHOP) failed\n"); + ret = __fpe_flt_rounds(); + ok(ret == 3 || broken(ret == 2) /* w1064v1507 */, "__fpe_flt_rounds returned %d\n", ret); + + ok((_controlfp(_RC_CHOP, _RC_CHOP) & _RC_CHOP) == _RC_CHOP, "_controlfp(_RC_CHOP, _RC_CHOP) failed\n"); + ret = __fpe_flt_rounds(); + ok(ret == 0, "__fpe_flt_rounds returned %d\n", ret); + + _controlfp(cfp, _MCW_EM | _MCW_RC | _MCW_PC); +} + +static void test__control87_2(void) +{ +#ifdef __i386__ + unsigned int x86_cw_init, sse2_cw_init, x86_cw, sse2_cw, r; + + r = __control87_2(0, 0, &x86_cw_init, &sse2_cw_init); + ok(r == 1, "__control87_2 returned %d\n", r); + + r = __control87_2(0, _EM_INVALID, &x86_cw, NULL); + ok(r == 1, "__control87_2 returned %d\n", r); + ok(x86_cw == (x86_cw_init & ~_EM_INVALID), "x86_cw = %x, x86_cw_init = %x\n", x86_cw, x86_cw_init); + + r = __control87_2(0, 0, &x86_cw, &sse2_cw); + ok(r == 1, "__control87_2 returned %d\n", r); + ok(x86_cw == (x86_cw_init & ~_EM_INVALID), "x86_cw = %x, x86_cw_init = %x\n", x86_cw, x86_cw_init); + ok(sse2_cw == sse2_cw_init, "sse2_cw = %x, sse2_cw_init = %x\n", sse2_cw, sse2_cw_init); + + r = _control87(0, 0); + ok(r == (x86_cw | sse2_cw | _EM_AMBIGUOUS), "r = %x, expected %x\n", + r, x86_cw | sse2_cw | _EM_AMBIGUOUS); + + _control87(x86_cw_init, ~0); +#endif +} + +static void __cdecl global_invalid_parameter_handler( + const wchar_t *expression, const wchar_t *function, + const wchar_t *file, unsigned line, uintptr_t arg) +{ + CHECK_EXPECT2(global_invalid_parameter_handler); +} + +static void __cdecl thread_invalid_parameter_handler( + const wchar_t *expression, const wchar_t *function, + const wchar_t *file, unsigned line, uintptr_t arg) +{ + CHECK_EXPECT(thread_invalid_parameter_handler); +} + +static void test_invalid_parameter_handler(void) +{ + _invalid_parameter_handler ret; + + ret = _get_invalid_parameter_handler(); + ok(!ret, "ret != NULL\n"); + + ret = _get_thread_local_invalid_parameter_handler(); + ok(!ret, "ret != NULL\n"); + + ret = _set_thread_local_invalid_parameter_handler(thread_invalid_parameter_handler); + ok(!ret, "ret != NULL\n"); + + ret = _get_thread_local_invalid_parameter_handler(); + ok(ret == thread_invalid_parameter_handler, "ret = %p\n", ret); + + ret = _get_invalid_parameter_handler(); + ok(!ret, "ret != NULL\n"); + + ret = _set_invalid_parameter_handler(global_invalid_parameter_handler); + ok(!ret, "ret != NULL\n"); + + ret = _get_invalid_parameter_handler(); + ok(ret == global_invalid_parameter_handler, "ret = %p\n", ret); + + ret = _get_thread_local_invalid_parameter_handler(); + ok(ret == thread_invalid_parameter_handler, "ret = %p\n", ret); + + SET_EXPECT(thread_invalid_parameter_handler); + _ltoa_s(0, NULL, 0, 0); + CHECK_CALLED(thread_invalid_parameter_handler); + + ret = _set_thread_local_invalid_parameter_handler(NULL); + ok(ret == thread_invalid_parameter_handler, "ret = %p\n", ret); + + SET_EXPECT(global_invalid_parameter_handler); + _ltoa_s(0, NULL, 0, 0); + CHECK_CALLED(global_invalid_parameter_handler); + + ret = _set_invalid_parameter_handler(NULL); + ok(ret == global_invalid_parameter_handler, "ret = %p\n", ret); + + ret = _set_invalid_parameter_handler(global_invalid_parameter_handler); + ok(!ret, "ret != NULL\n"); +} + +static void test__get_narrow_winmain_command_line(char *path) +{ + PROCESS_INFORMATION proc; + STARTUPINFOA startup; + char cmd[MAX_PATH+32]; + char *ret, *cmdline, *name; + int len; + + ret = _get_narrow_winmain_command_line(); + cmdline = GetCommandLineA(); + len = strlen(cmdline); + ok(ret>cmdline && ret0; len--) + if(path[len-1]=='\\' || path[len-1]=='/') break; + if(len) name = path+len; + else name = path; + + sprintf(cmd, "\"\"%c\"\"\"%s\" \t \"misc\" cmd", name[0], name+1); + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + CreateProcessA(path, cmd, NULL, NULL, TRUE, + CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS, + NULL, NULL, &startup, &proc); + wait_child_process(proc.hProcess); + CloseHandle(proc.hProcess); + CloseHandle(proc.hThread); +} + +static void test__sopen_dispatch(void) +{ + int ret, fd; + char *tempf; + + tempf = _tempnam(".", "wne"); + + fd = 0; + ret = _sopen_dispatch(tempf, _O_CREAT, _SH_DENYWR, 0xff, &fd, 0); + ok(!ret, "got %d\n", ret); + ok(fd > 0, "got fd %d\n", fd); + _close(fd); + unlink(tempf); + + SET_EXPECT(global_invalid_parameter_handler); + fd = 0; + ret = _sopen_dispatch(tempf, _O_CREAT, _SH_DENYWR, 0xff, &fd, 1); + ok(ret == EINVAL, "got %d\n", ret); + ok(fd == -1, "got fd %d\n", fd); + CHECK_CALLED(global_invalid_parameter_handler); + if (fd > 0) + { + _close(fd); + unlink(tempf); + } + + free(tempf); +} + +static void test__sopen_s(void) +{ + int ret, fd; + char *tempf; + + tempf = _tempnam(".", "wne"); + + fd = 0; + ret = _sopen_s(&fd, tempf, _O_CREAT, _SH_DENYWR, 0); + ok(!ret, "got %d\n", ret); + ok(fd > 0, "got fd %d\n", fd); + _close(fd); + unlink(tempf); + + /* _open() does not validate pmode */ + fd = _open(tempf, _O_CREAT, 0xff); + ok(fd > 0, "got fd %d\n", fd); + _close(fd); + unlink(tempf); + + /* _sopen_s() invokes invalid parameter handler on invalid pmode */ + SET_EXPECT(global_invalid_parameter_handler); + fd = 0; + ret = _sopen_s(&fd, tempf, _O_CREAT, _SH_DENYWR, 0xff); + ok(ret == EINVAL, "got %d\n", ret); + ok(fd == -1, "got fd %d\n", fd); + CHECK_CALLED(global_invalid_parameter_handler); + + free(tempf); +} + +static void test_lldiv(void) +{ + lldiv_t r; + + r = lldiv(((LONGLONG)0x111 << 32) + 0x222, (LONGLONG)1 << 32); + ok(r.quot == 0x111, "quot = %s\n", wine_dbgstr_longlong(r.quot)); + ok(r.rem == 0x222, "rem = %s\n", wine_dbgstr_longlong(r.rem)); + + r = lldiv(((LONGLONG)0x69CF0012 << 32) + 0x0033E78A, 0x30); + ok(r.quot == ((LONGLONG)0x02345000 << 32) + 0x600114D2, "quot = %s\n", wine_dbgstr_longlong(r.quot)); + ok(r.rem == 0x2A, "rem = %s\n", wine_dbgstr_longlong(r.rem)); + + r = lldiv(((LONGLONG)0x243A5678 << 32) + 0x9ABCDEF0, (LONGLONG)0x12 << 48); + ok(r.quot == 0x0203, "quot = %s\n", wine_dbgstr_longlong(r.quot)); + ok(r.rem == ((LONGLONG)0x00045678 << 32) + 0x9ABCDEF0, "rem = %s\n", wine_dbgstr_longlong(r.rem)); +} + +static void test_isblank(void) +{ + int c; + + for(c = 0; c <= 0xff; c++) { + if(c == '\t' || c == ' ') { + if(c == '\t') + ok(!_isctype(c, _BLANK), "tab shouldn't be blank\n"); + else + ok(_isctype(c, _BLANK), "space should be blank\n"); + ok(isblank(c), "%d should be blank\n", c); + ok(_isblank_l(c, NULL), "%d should be blank\n", c); + } else { + ok(!_isctype(c, _BLANK), "%d shouldn't be blank\n", c); + ok(!isblank(c), "%d shouldn't be blank\n", c); + ok(!_isblank_l(c, NULL), "%d shouldn't be blank\n", c); + } + } + + for(c = 0; c <= 0xffff; c++) { + if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) { + if(c == '\t') + ok(!_iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n"); + else + ok(_iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c); + ok(iswblank(c), "%d should be blank\n", c); + ok(_iswblank_l(c, NULL), "%d should be blank\n", c); + } else { + ok(!_iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c); + ok(!iswblank(c), "%d shouldn't be blank\n", c); + ok(!_iswblank_l(c, NULL), "%d shouldn't be blank\n", c); + } + } +} + +static struct _exception exception; + +static int CDECL matherr_callback(struct _exception *e) +{ + exception = *e; + + if (!strcmp(e->name, "acos") && e->arg1 == 2) + e->retval = -1; + return 0; +} + +static void test_math_errors(void) +{ + const struct { + char func[16]; + double x; + int error; + int exception; + } testsd[] = { + {"_logb", -INFINITY, -1, -1}, + {"_logb", -1, -1, -1}, + {"_logb", 0, ERANGE, _SING}, + {"_logb", INFINITY, -1, -1}, + {"acos", -INFINITY, EDOM, _DOMAIN}, + {"acos", -2, EDOM, _DOMAIN}, + {"acos", -1, -1, -1}, + {"acos", 1, -1, -1}, + {"acos", 2, EDOM, _DOMAIN}, + {"acos", INFINITY, EDOM, _DOMAIN}, + {"acosh", -INFINITY, EDOM, -1}, + {"acosh", 0, EDOM, -1}, + {"acosh", 1, -1, -1}, + {"acosh", INFINITY, -1, -1}, + {"asin", -INFINITY, EDOM, _DOMAIN}, + {"asin", -2, EDOM, _DOMAIN}, + {"asin", -1, -1, -1}, + {"asin", 1, -1, -1}, + {"asin", 2, EDOM, _DOMAIN}, + {"asin", INFINITY, EDOM, _DOMAIN}, + {"asinh", -INFINITY, -1, -1}, + {"asinh", INFINITY, -1, -1}, + {"atan", -INFINITY, -1, -1}, + {"atan", 0, -1, -1}, + {"atan", INFINITY, -1, -1}, + {"atanh", -INFINITY, EDOM, -1}, + {"atanh", -2, EDOM, -1}, + {"atanh", -1, ERANGE, -1}, + {"atanh", 1, ERANGE, -1}, + {"atanh", 2, EDOM, -1}, + {"atanh", INFINITY, EDOM, -1}, + {"cos", -INFINITY, EDOM, _DOMAIN}, + {"cos", INFINITY, EDOM, _DOMAIN}, + {"cosh", -INFINITY, -1, -1}, + {"cosh", 0, -1, -1}, + {"cosh", INFINITY, -1, -1}, + {"exp", -INFINITY, -1, -1}, + {"exp", -1e100, -1, _UNDERFLOW}, + {"exp", 1e100, ERANGE, _OVERFLOW}, + {"exp", INFINITY, -1, -1}, + {"exp2", -INFINITY, -1, -1}, + {"exp2", -1e100, -1, -1}, + {"exp2", 1e100, ERANGE, -1}, + {"exp2", INFINITY, -1, -1}, + {"expm1", -INFINITY, -1, -1}, + {"expm1", INFINITY, -1, -1}, + {"log", -INFINITY, EDOM, _DOMAIN}, + {"log", -1, EDOM, _DOMAIN}, + {"log", 0, ERANGE, _SING}, + {"log", INFINITY, -1, -1}, + {"log10", -INFINITY, EDOM, _DOMAIN}, + {"log10", -1, EDOM, _DOMAIN}, + {"log10", 0, ERANGE, _SING}, + {"log10", INFINITY, -1, -1}, + {"log1p", -INFINITY, EDOM, -1}, + {"log1p", -2, EDOM, -1}, + {"log1p", -1, ERANGE, -1}, + {"log1p", INFINITY, -1, -1}, + {"log2", INFINITY, -1, -1}, + {"sin", -INFINITY, EDOM, _DOMAIN}, + {"sin", INFINITY, EDOM, _DOMAIN}, + {"sinh", -INFINITY, -1, -1}, + {"sinh", 0, -1, -1}, + {"sinh", INFINITY, -1, -1}, + {"sqrt", -INFINITY, EDOM, _DOMAIN}, + {"sqrt", -1, EDOM, _DOMAIN}, + {"sqrt", 0, -1, -1}, + {"sqrt", INFINITY, -1, -1}, + {"tan", -INFINITY, EDOM, _DOMAIN}, + {"tan", -M_PI_2, -1, -1}, + {"tan", M_PI_2, -1, -1}, + {"tan", INFINITY, EDOM, _DOMAIN}, + {"tanh", -INFINITY, -1, -1}, + {"tanh", 0, -1, -1}, + {"tanh", INFINITY, -1, -1}, + }; + const struct { + char func[16]; + double a; + double b; + int error; + int exception; + } tests2d[] = { + {"atan2", -INFINITY, 0, -1, -1}, + {"atan2", 0, 0, -1, -1}, + {"atan2", INFINITY, 0, -1, -1}, + {"atan2", 0, -INFINITY, -1, -1}, + {"atan2", 0, INFINITY, -1, -1}, + {"pow", -INFINITY, -2, -1, -1}, + {"pow", -INFINITY, -1, -1, -1}, + {"pow", -INFINITY, 0, -1, -1}, + {"pow", -INFINITY, 1, -1, -1}, + {"pow", -INFINITY, 2, -1, -1}, + {"pow", -1e100, -10, -1, _UNDERFLOW}, + {"pow", -1e100, 10, ERANGE, _OVERFLOW}, + {"pow", -1, 1.5, EDOM, _DOMAIN}, + {"pow", 0, -2, ERANGE, _SING}, + {"pow", 0, -1, ERANGE, _SING}, + {"pow", 0.5, -INFINITY, -1, -1}, + {"pow", 0.5, INFINITY, -1, -1}, + {"pow", 2, -INFINITY, -1, -1}, + {"pow", 2, -1e100, -1, _UNDERFLOW}, + {"pow", 2, 1e100, ERANGE, _OVERFLOW}, + {"pow", 2, INFINITY, -1, -1}, + {"pow", 1e100, -10, -1, _UNDERFLOW}, + {"pow", 1e100, 10, ERANGE, _OVERFLOW}, + {"pow", INFINITY, -2, -1, -1}, + {"pow", INFINITY, -1, -1, -1}, + {"pow", INFINITY, 0, -1, -1}, + {"pow", INFINITY, 1, -1, -1}, + {"pow", INFINITY, 2, -1, -1}, + }; + const struct { + char func[16]; + double a; + double b; + double c; + int error; + int exception; + } tests3d[] = { + /* 0 * inf --> EDOM */ + {"fma", INFINITY, 0, 0, EDOM, -1}, + {"fma", 0, INFINITY, 0, EDOM, -1}, + /* inf - inf -> EDOM */ + {"fma", INFINITY, 1, -INFINITY, EDOM, -1}, + {"fma", -INFINITY, 1, INFINITY, EDOM, -1}, + {"fma", 1, INFINITY, -INFINITY, EDOM, -1}, + {"fma", 1, -INFINITY, INFINITY, EDOM, -1}, + /* NaN */ + {"fma", NAN, 0, 0, -1, -1}, + {"fma", 0, NAN, 0, -1, -1}, + {"fma", 0, 0, NAN, -1, -1}, + /* over/underflow */ + {"fma", __port_max_double(), __port_max_double(), __port_max_double(), -1, -1}, + {"fma", __port_min_pos_double(), __port_min_pos_double(), 1, -1, -1}, + }; + const struct { + char func[16]; + double a; + long b; + int error; + int exception; + } testsdl[] = { + {"_scalb", -INFINITY, 1, -1, -1}, + {"_scalb", -1e100, 1, -1, -1}, + {"_scalb", 0, 1, -1, -1}, + {"_scalb", 1e100, 1, -1, -1}, + {"_scalb", INFINITY, 1, -1, -1}, + {"_scalb", 1, 1e9, ERANGE, _OVERFLOW}, + {"ldexp", -INFINITY, 1, -1, -1}, + {"ldexp", -1e100, 1, -1, -1}, + {"ldexp", 0, 1, -1, -1}, + {"ldexp", 1e100, 1, -1, -1}, + {"ldexp", INFINITY, 1, -1, -1}, + {"ldexp", 1, -1e9, -1, _UNDERFLOW}, + {"ldexp", 1, 1e9, ERANGE, _OVERFLOW}, + }; + double (CDECL *p_funcd)(double); + double (CDECL *p_func2d)(double, double); + double (CDECL *p_func3d)(double, double, double); + double (CDECL *p_funcdl)(double, long); + HMODULE module; + double d; + int i; + + __setusermatherr(matherr_callback); + module = GetModuleHandleW(L"ucrtbase.dll"); + + /* necessary so that exp(1e100)==INFINITY on glibc, we can remove this if we change our implementation */ + fesetround(FE_TONEAREST); + + for(i = 0; i < ARRAY_SIZE(testsd); i++) { + p_funcd = (void*)GetProcAddress(module, testsd[i].func); + errno = -1; + exception.type = -1; + p_funcd(testsd[i].x); + ok(errno == testsd[i].error, + "%s(%f) got errno %d\n", testsd[i].func, testsd[i].x, errno); + ok(exception.type == testsd[i].exception, + "%s(%f) got exception type %d\n", testsd[i].func, testsd[i].x, exception.type); + if(exception.type == -1) continue; + ok(exception.arg1 == testsd[i].x, + "%s(%f) got exception arg1 %f\n", testsd[i].func, testsd[i].x, exception.arg1); + } + + for(i = 0; i < ARRAY_SIZE(tests2d); i++) { + p_func2d = (void*)GetProcAddress(module, tests2d[i].func); + errno = -1; + exception.type = -1; + p_func2d(tests2d[i].a, tests2d[i].b); + ok(errno == tests2d[i].error, + "%s(%f, %f) got errno %d\n", tests2d[i].func, tests2d[i].a, tests2d[i].b, errno); + ok(exception.type == tests2d[i].exception, + "%s(%f, %f) got exception type %d\n", tests2d[i].func, tests2d[i].a, tests2d[i].b, exception.type); + if(exception.type == -1) continue; + ok(exception.arg1 == tests2d[i].a, + "%s(%f, %f) got exception arg1 %f\n", tests2d[i].func, tests2d[i].a, tests2d[i].b, exception.arg1); + ok(exception.arg2 == tests2d[i].b, + "%s(%f, %f) got exception arg2 %f\n", tests2d[i].func, tests2d[i].a, tests2d[i].b, exception.arg2); + } + + for(i = 0; i < ARRAY_SIZE(tests3d); i++) { + p_func3d = (void*)GetProcAddress(module, tests3d[i].func); + errno = -1; + exception.type = -1; + p_func3d(tests3d[i].a, tests3d[i].b, tests3d[i].c); + ok(errno == tests3d[i].error, + "%s(%f, %f, %f) got errno %d\n", tests3d[i].func, tests3d[i].a, tests3d[i].b, tests3d[i].c, errno); + ok(exception.type == tests3d[i].exception, + "%s(%f, %f, %f) got exception type %d\n", tests3d[i].func, tests3d[i].a, tests3d[i].b, tests3d[i].c, exception.type); + if(exception.type == -1) continue; + ok(exception.arg1 == tests3d[i].a, + "%s(%f, %f, %f) got exception arg1 %f\n", tests3d[i].func, tests3d[i].a, tests3d[i].b, tests3d[i].c, exception.arg1); + ok(exception.arg2 == tests3d[i].b, + "%s(%f, %f, %f) got exception arg2 %f\n", tests3d[i].func, tests3d[i].a, tests3d[i].b, tests3d[i].c, exception.arg2); + } + + for(i = 0; i < ARRAY_SIZE(testsdl); i++) { + p_funcdl = (void*)GetProcAddress(module, testsdl[i].func); + errno = -1; + exception.type = -1; + p_funcdl(testsdl[i].a, testsdl[i].b); + ok(errno == testsdl[i].error, + "%s(%f, %ld) got errno %d\n", testsdl[i].func, testsdl[i].a, testsdl[i].b, errno); + ok(exception.type == testsdl[i].exception, + "%s(%f, %ld) got exception type %d\n", testsdl[i].func, testsdl[i].a, testsdl[i].b, exception.type); + if(exception.type == -1) continue; + ok(exception.arg1 == testsdl[i].a, + "%s(%f, %ld) got exception arg1 %f\n", testsdl[i].func, testsdl[i].a, testsdl[i].b, exception.arg1); + ok(exception.arg2 == testsdl[i].b, + "%s(%f, %ld) got exception arg2 %f\n", testsdl[i].func, testsdl[i].a, testsdl[i].b, exception.arg2); + } + + d = acos(2.0); + ok(d == -1.0, "failed to change log10 return value: %e\n", d); +} + +static void test_asctime(void) +{ + const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 }; + char *ret; + + ret = asctime(&epoch); + ok(!strcmp(ret, "Thu Jan 1 00:00:00 1970\n"), "asctime returned %s\n", ret); +} + +static void test_strftime(void) +{ + const struct { + const char *format; + const char *ret; + struct tm tm; + BOOL todo_value; + BOOL todo_handler; + } tests[] = { + {"%C", "", { 0, 0, 0, 1, 0, -2000, 4, 0, 0 }}, + {"%C", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }}, + {"%C", "00", { 0, 0, 0, 1, 0, -1900, 4, 0, 0 }}, + {"%C", "18", { 0, 0, 0, 1, 0, -1, 4, 0, 0 }}, + {"%C", "19", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%C", "99", { 0, 0, 0, 1, 0, 8099, 4, 0, 0 }}, + {"%C", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }}, + {"%d", "", { 0, 0, 0, 0, 0, 70, 4, 0, 0 }}, + {"%d", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%d", "31", { 0, 0, 0, 31, 0, 70, 4, 0, 0 }}, + {"%d", "", { 0, 0, 0, 32, 0, 70, 4, 0, 0 }}, + {"%D", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }}, + {"%D", "01/01/00", { 0, 0, 0, 1, 0, -1900, 4, 0, 0 }}, + {"%D", "01/01/99", { 0, 0, 0, 1, 0, -1, 4, 0, 0 }}, + {"%D", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%D", "01/01/99", { 0, 0, 0, 1, 0, 8099, 4, 0, 0 }}, + {"%D", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }}, + {"%#D", "1/1/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%e", "", { 0, 0, 0, 0, 0, 70, 4, 0, 0 }}, + {"%e", " 1", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%e", "31", { 0, 0, 0, 31, 0, 70, 4, 0, 0 }}, + {"%e", "", { 0, 0, 0, 32, 0, 70, 4, 0, 0 }}, + {"%#e", "1", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%F", "1970-01-01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#F", "1970-1-1", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%R", "00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#R", "0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%T", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#T", "0:0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%u", "", { 0, 0, 0, 1, 0, 117, -1, 0, 0 }}, + {"%u", "7", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%u", "1", { 0, 0, 0, 1, 0, 117, 1, 0, 0 }}, + {"%u", "6", { 0, 0, 0, 1, 0, 117, 6, 0, 0 }}, + {"%u", "", { 0, 0, 0, 1, 0, 117, 7, 0, 0 }}, + {"%h", "Jan", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%I", "", { 0, 0, -1, 1, 0, 70, 4, 0, 0 }}, + {"%I", "12", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%I", "01", { 0, 0, 1, 1, 0, 70, 4, 0, 0 }}, + {"%I", "11", { 0, 0, 11, 1, 0, 70, 4, 0, 0 }}, + {"%I", "12", { 0, 0, 12, 1, 0, 70, 4, 0, 0 }}, + {"%I", "01", { 0, 0, 13, 1, 0, 70, 4, 0, 0 }}, + {"%I", "11", { 0, 0, 23, 1, 0, 70, 4, 0, 0 }}, + {"%I", "", { 0, 0, 24, 1, 0, 70, 4, 0, 0 }}, + {"%n", "\n", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%r", "12:00:00 AM", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%r", "02:00:00 PM", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }}, + {"%#r", "12:0:0 AM", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#r", "2:0:0 PM", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }}, + {"%t", "\t", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 3, 364, 0 }}, + {"%g", "00", { 0, 0, 0, 1, 0, -1900, 4, 0, 0 }}, + {"%g", "70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%g", "71", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, + {"%g", "72", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, + {"%g", "16", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%g", "99", { 0, 0, 0, 1, 0, 8099, 4, 0, 0 }}, + {"%g", "00", { 0, 0, 0, 1, 0, 8099, 3, 364, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 0, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }}, + {"%G", "1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%G", "1971", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, + {"%G", "1972", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, + {"%G", "2016", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%V", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%V", "52", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%V", "53", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }}, + {"%y", "", { 0, 0, 0, 0, 0, -1901, 0, 0, 0 }}, + {"%y", "00", { 0, 0, 0, 0, 0, -1900, 0, 0, 0 }}, + {"%y", "99", { 0, 0, 0, 0, 0, 8099, 0, 0, 0 }}, + {"%y", "", { 0, 0, 0, 0, 0, 8100, 0, 0, 0 }}, + {"%c", "Thu Jan 1 00:00:00 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%c", "Thu Feb 30 00:00:00 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }}, + {"%#c", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#c", "Thursday, February 30, 1970 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }}, + {"%x", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%x", "02/30/70", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }}, + {"%#x", "Thursday, January 01, 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%#x", "Thursday, February 30, 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }}, + {"%#x", "", { 0, 0, 0, 30, 1, 70, 7, 0, 0 }}, + {"%#x", "", { 0, 0, 0, 30, 12, 70, 4, 0, 0 }}, + {"%X", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%X", "14:00:00", { 0, 0, 14, 1, 0, 70, 4, 0, 0 }}, + {"%X", "23:59:60", { 60, 59, 23, 1, 0, 70, 4, 0, 0 }}, + }; + + const struct { + const char *format; + const char *ret; + const wchar_t *short_date; + const wchar_t *date; + const wchar_t *time; + struct tm tm; + BOOL todo; + } tests_td[] = { + { "%c", "x z", L"x", L"y", L"z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#c", "y z", L"x", L"y", L"z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "M1", 0, 0, L"MMM", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "1", 0, 0, L"h", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, L"hh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "h01", 0, 0, L"hhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "hh01", 0, 0, L"hhhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "1", 0, 0, L"H", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, L"HH", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "H13", 0, 0, L"HHH", { 0, 0, 13, 1, 0, 70, 0, 0, 0 }}, + { "%X", "0", 0, 0, L"m", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "00", 0, 0, L"mm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "m00", 0, 0, L"mmm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "0", 0, 0, L"s", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "00", 0, 0, L"ss", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "s00", 0, 0, L"sss", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "T", 0, 0, L"t", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"tt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"ttttttttt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"a", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"aaaaa", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"A", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "TAM", 0, 0, L"AAAAA", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "1", L"d", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", L"dd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "D1", L"ddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "Day1", L"dddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "dDay1", L"ddddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "1", L"M", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", L"MM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "M1", L"MMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "Mon1", L"MMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "MMon1", L"MMMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y", L"y", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "70", L"yy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y70", L"yyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "1970", L"yyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y1970", L"yyyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "ggggggggggg", L"ggggggggggg", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "1", 0, L"d", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, L"dd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "D1", 0, L"ddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "Day1", 0, L"dddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "dDay1", 0, L"ddddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "1", 0, L"M", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, L"MM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "M1", 0, L"MMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "Mon1", 0, L"MMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "MMon1", 0, L"MMMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y", 0, L"y", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "70", 0, L"yy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y70", 0, L"yyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "1970", 0, L"yyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y1970", 0, L"yyyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%r", "z", L"x", L"y", L"z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + }; + + const struct { + int year; + int yday; + const char *ret[7]; + } tests_yweek[] = { + { 100, 0, { "99 52", "00 01", "00 01", "00 01", "00 01", "99 53", "99 52" }}, + { 100, 1, { "99 52", "00 01", "00 01", "00 01", "00 01", "00 01", "99 53" }}, + { 100, 2, { "99 53", "00 01", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 3, { "00 01", "00 01", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 4, { "00 01", "00 02", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 5, { "00 01", "00 02", "00 02", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 6, { "00 01", "00 02", "00 02", "00 02", "00 01", "00 01", "00 01" }}, + { 100, 358, { "00 51", "00 52", "00 52", "00 52", "00 52", "00 52", "00 51" }}, + { 100, 359, { "00 51", "00 52", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 360, { "00 52", "00 52", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 361, { "00 52", "00 53", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 362, { "00 52", "00 53", "00 53", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 363, { "00 52", "01 01", "00 53", "00 53", "00 52", "00 52", "00 52" }}, + { 100, 364, { "00 52", "01 01", "01 01", "00 53", "00 53", "00 52", "00 52" }}, + { 100, 365, { "00 52", "01 01", "01 01", "01 01", "00 53", "00 53", "00 52" }}, + { 101, 0, { "00 52", "01 01", "01 01", "01 01", "01 01", "00 53", "00 53" }}, + { 101, 1, { "00 53", "01 01", "01 01", "01 01", "01 01", "01 01", "00 53" }}, + { 101, 2, { "00 53", "01 01", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 3, { "01 01", "01 01", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 4, { "01 01", "01 02", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 5, { "01 01", "01 02", "01 02", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 6, { "01 01", "01 02", "01 02", "01 02", "01 01", "01 01", "01 01" }}, + { 101, 358, { "01 51", "01 52", "01 52", "01 52", "01 52", "01 52", "01 51" }}, + { 101, 359, { "01 51", "01 52", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 360, { "01 52", "01 52", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 361, { "01 52", "01 53", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 362, { "01 52", "02 01", "01 53", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 363, { "01 52", "02 01", "02 01", "01 53", "01 52", "01 52", "01 52" }}, + { 101, 364, { "01 52", "02 01", "02 01", "02 01", "01 53", "01 52", "01 52" }}, + }; + + __lc_time_data time_data = { + { "d1", "d2", "d3", "d4", "d5", "d6", "d7" }, + { "day1", "day2", "day3", "day4", "day5", "day6", "day7" }, + { "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10", "m11", "m12" }, + { "mon1", "mon2", "mon3", "mon4", "mon5", "mon6", "mon7", "mon8", "mon9", "mon10", "mon11", "mon12" }, + "tam", "tpm", 0, 0, 0, 1, 0, + { L"D1", L"D2", L"D3", L"D4", L"D5", L"D6", L"D7" }, + { L"Day1", L"Day2", L"Day3", L"Day4", L"Day5", L"Day6", L"Day7" }, + { L"M1", L"M2", L"M3", L"M4", L"M5", L"M6", L"M7", L"M8", L"M9", L"M10", L"M11", L"M12" }, + { L"Mon1", L"Mon2", L"Mon3", L"Mon4", L"Mon5", L"Mon6", L"Mon7", L"Mon8", L"Mon9", L"Mon10", L"Mon11", L"Mon12" }, + L"TAM", L"TPM" + }; + + const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 }; + struct tm tm_yweek = { 0, 0, 0, 1, 0, 70, 0, 0, 0 }; + char buf[256]; + int i, ret=0; + + for (i=0; i= 0) + { + ret = _stat32(path, &buf); + ok(!ret, "_stat32('%s') returned %d\n", path, ret); + strcat(path, "\\"); + ret = _stat32(path, &buf); + todo_wine ok(ret, "_stat32('%s') returned %d\n", path, ret); + close(fd); + remove(path); + } + + memcpy(path+len, test_dir, sizeof(test_dir)); + if(!mkdir(path)) + { + ret = _stat32(path, &buf); + ok(!ret, "_stat32('%s') returned %d\n", path, ret); + strcat(path, "\\"); + ret = _stat32(path, &buf); + ok(!ret, "_stat32('%s') returned %d\n", path, ret); + rmdir(path); + } +} + +static void test__o_malloc(void) +{ + void *m; + size_t s; + + m = _o_malloc(1); + ok(m != NULL, "p__o_malloc(1) returned NULL\n"); + + s = _msize(m); + ok(s == 1, "_msize returned %d\n", (int)s); + + free(m); +} + +static void test_clock(void) +{ + static const int thresh = 100, max_load_delay = 1000; + int c, expect_min; + FILETIME cur; + + GetSystemTimeAsFileTime(&cur); + c = clock(); + + expect_min = (((LONGLONG)cur.dwHighDateTime << 32) + cur.dwLowDateTime - crt_init_end) / 10000; + ok(c >= expect_min - thresh && c < expect_min + max_load_delay, "clock() = %d, expected range [%d, %d]\n", + c, expect_min - thresh, expect_min + max_load_delay); +} + +static void __cdecl se_translator(unsigned int u, EXCEPTION_POINTERS *ep) +{ +} + +static void test_thread_storage(void) +{ + void **current_exception; + void *processing_throw; + + _set_se_translator(se_translator); + current_exception = __current_exception(); + processing_throw = __processing_throw(); + + ok(current_exception+2 == processing_throw, + "current_exception = %p, processing_throw = %p\n", + current_exception, processing_throw); + ok(current_exception[-2] == se_translator, + "can't find se_translator in thread storage\n"); +} + +START_TEST(misc) +{ + int arg_c; + char** arg_v; + FILETIME cur; + + GetSystemTimeAsFileTime(&cur); + crt_init_end = ((LONGLONG)cur.dwHighDateTime << 32) + cur.dwLowDateTime; + + arg_c = winetest_get_mainargs(&arg_v); + if(arg_c == 3) { + if(!strcmp(arg_v[2], "cmd")) + test__get_narrow_winmain_command_line(NULL); + else if(!strcmp(arg_v[2], "exit")) + test_call_exit(); + else if(!strcmp(arg_v[2], "quick_exit")) + test_call_quick_exit(); + return; + } + + test_invalid_parameter_handler(); + test__initialize_onexit_table(); + test__register_onexit_function(); + test__execute_onexit_table(); + test___fpe_flt_rounds(); + test__control87_2(); + test__get_narrow_winmain_command_line(arg_v[0]); + test__sopen_dispatch(); + test__sopen_s(); + test_lldiv(); + test_isblank(); + test_math_errors(); + test_asctime(); + test_strftime(); + test_exit(arg_v[0]); + test_quick_exit(arg_v[0]); + test__stat32(); + test__o_malloc(); + test_clock(); + test_thread_storage(); +} diff --git a/wrappers/new-dlls/ucrtbase/tests/printf.c b/wrappers/new-dlls/ucrtbase/tests/printf.c new file mode 100644 index 00000000000..96241b22cf0 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/printf.c @@ -0,0 +1,864 @@ +/* + * Conformance tests for *printf functions. + * + * Copyright 2002 Uwe Bonnes + * Copyright 2004 Aneurin Price + * Copyright 2005 Mike McCormack + * Copyright 2015 Martin Storsjo + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "wine/test.h" + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(invalid_parameter_handler); + +static inline float __port_ind(void) +{ + static const unsigned __ind_bytes = 0xffc00000; + return *(const float *)&__ind_bytes; +} +#define IND __port_ind() + +static void __cdecl test_invalid_parameter_handler(const wchar_t *expression, + const wchar_t *function, const wchar_t *file, + unsigned line, uintptr_t arg) +{ + CHECK_EXPECT(invalid_parameter_handler); + ok(expression == NULL, "expression is not NULL\n"); + ok(function == NULL, "function is not NULL\n"); + ok(file == NULL, "file is not NULL\n"); + ok(line == 0, "line = %u\n", line); + ok(arg == 0, "arg = %lx\n", (UINT_PTR)arg); +} + +static int WINAPIV vsprintf_wrapper(unsigned __int64 options, char *str, + size_t len, const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vsprintf(options, str, len, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_snprintf (void) +{ + const char *tests[] = {"short", "justfit", "justfits", "muchlonger", "", "1"}; + char buffer[8]; + int bufsizes[] = { 0, 1, sizeof(buffer) }; + unsigned int i, j; + + for (j = 0; j < ARRAY_SIZE(bufsizes); j++) { + const int bufsiz = bufsizes[j]; + /* Legacy _snprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt) > bufsiz ? -1 : strlen(fmt); + const int n = vsprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz : (n == bufsiz ? n : n+1); + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\"\n", fmt, valid, buffer); + } + + /* C99 snprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt); + const int n = vsprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, bufsiz, fmt); + const int valid = n >= bufsiz ? (bufsiz > 0 ? bufsiz - 1 : 0) : n < 0 ? 0 : n; + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\" bufsiz %d\n", fmt, valid, buffer, bufsiz); + ok (bufsiz == 0 || buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d (bufsiz %d)\n", fmt, n, buffer[valid], bufsiz); + } + + /* swprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt) >= bufsiz ? bufsiz > 0 ? -2 : -1 : strlen(fmt); + const int n = vsprintf_wrapper (0, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz > 0 ? bufsiz - 1 : 0 : n; + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\" bufsiz %d\n", fmt, valid, buffer, bufsiz); + ok (bufsiz == 0 || buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", fmt, n, buffer[valid]); + } + } + + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, "abcd") == 4, + "Failure to snprintf to NULL\n"); + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, NULL, 0, "abcd") == 4, + "Failure to snprintf to NULL\n"); + ok (vsprintf_wrapper (0, NULL, 0, "abcd") == 4, + "Failure to snprintf to NULL\n"); + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, 0, "abcd") == 4, + "Failure to snprintf to zero length buffer\n"); + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, 0, "abcd") == -1, + "Failure to snprintf to zero length buffer\n"); + ok (vsprintf_wrapper (0, buffer, 0, "abcd") == -1, + "Failure to snprintf to zero length buffer\n"); + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, 0, "") == 0, + "Failure to snprintf a zero length string to a zero length buffer\n"); + ok (vsprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, 0, "") == 0, + "Failure to snprintf a zero length string to a zero length buffer\n"); + ok (vsprintf_wrapper (0, buffer, 0, "") == -1, + "Failure to snprintf a zero length string to a zero length buffer\n"); +} + +static int WINAPIV vswprintf_wrapper(unsigned __int64 options, wchar_t *str, + size_t len, const wchar_t *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vswprintf(options, str, len, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_swprintf (void) +{ + const wchar_t str_short[] = {'s','h','o','r','t',0}; + const wchar_t str_justfit[] = {'j','u','s','t','f','i','t',0}; + const wchar_t str_justfits[] = {'j','u','s','t','f','i','t','s',0}; + const wchar_t str_muchlonger[] = {'m','u','c','h','l','o','n','g','e','r',0}; + const wchar_t str_empty[] = {0}; + const wchar_t *tests[] = {str_short, str_justfit, str_justfits, str_muchlonger}; + + wchar_t buffer[8]; + char narrow[8], narrow_fmt[16]; + const int bufsiz = ARRAY_SIZE(buffer); + unsigned int i; + + /* Legacy _snprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt) > bufsiz ? -1 : wcslen(fmt); + const int n = vswprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz : (n == bufsiz ? n : n+1); + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + } + + /* C99 snprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt); + const int n = vswprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, bufsiz, fmt); + const int valid = n >= bufsiz ? bufsiz - 1 : n < 0 ? 0 : n; + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt, n, buffer[valid]); + } + + /* swprintf style termination */ + for (i = 0; i < ARRAY_SIZE(tests); i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt) >= bufsiz ? -2 : wcslen(fmt); + const int n = vswprintf_wrapper (0, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz - 1 : n; + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt, n, buffer[valid]); + } + + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, str_short) == 5, + "Failure to swprintf to NULL\n"); + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, NULL, 0, str_short) == 5, + "Failure to swprintf to NULL\n"); + ok (vswprintf_wrapper (0, NULL, 0, str_short) == 5, + "Failure to swprintf to NULL\n"); + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, 0, str_short) == 5, + "Failure to swprintf to a zero length buffer\n"); + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, 0, str_short) == -1, + "Failure to swprintf to a zero length buffer\n"); + ok (vswprintf_wrapper (0, buffer, 0, str_short) == -1, + "Failure to swprintf to a zero length buffer\n"); + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, buffer, 0, str_empty) == 0, + "Failure to swprintf a zero length string to a zero length buffer\n"); + ok (vswprintf_wrapper (_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, 0, str_empty) == 0, + "Failure to swprintf a zero length string to a zero length buffer\n"); + ok (vswprintf_wrapper (0, buffer, 0, str_empty) == -1, + "Failure to swprintf a zero length string to a zero length buffer\n"); +} + +static int WINAPIV vfprintf_wrapper(FILE *file, + const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vfprintf(0, file, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_fprintf(void) +{ + static const char file_name[] = "fprintf.tst"; + + FILE *fp = fopen(file_name, "wb"); + char buf[1024]; + int ret; + + ret = vfprintf_wrapper(fp, "simple test\n"); + ok(ret == 12, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 12, "ftell returned %d\n", ret); + + ret = vfprintf_wrapper(fp, "contains%cnull\n", '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 26, "ftell returned %d\n", ret); + + fclose(fp); + + fp = fopen(file_name, "rb"); + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 12, "ftell returned %d\n", ret); + ok(!strcmp(buf, "simple test\n"), "buf = %s\n", buf); + + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 26, "ret = %d\n", ret); + ok(!memcmp(buf, "contains\0null\n", 14), "buf = %s\n", buf); + + fclose(fp); + + fp = fopen(file_name, "wt"); + + ret = vfprintf_wrapper(fp, "simple test\n"); + ok(ret == 12, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + + ret = vfprintf_wrapper(fp, "contains%cnull\n", '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 28, "ftell returned %d\n", ret); + + fclose(fp); + + fp = fopen(file_name, "rb"); + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + ok(!strcmp(buf, "simple test\r\n"), "buf = %s\n", buf); + + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 28, "ret = %d\n", ret); + ok(!memcmp(buf, "contains\0null\r\n", 15), "buf = %s\n", buf); + + fclose(fp); + unlink(file_name); +} + +static int WINAPIV vfwprintf_wrapper(FILE *file, + const wchar_t *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vfwprintf(0, file, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_fwprintf(void) +{ + static const char file_name[] = "fprintf.tst"; + static const WCHAR simple[] = {'s','i','m','p','l','e',' ','t','e','s','t','\n',0}; + static const WCHAR cont_fmt[] = {'c','o','n','t','a','i','n','s','%','c','n','u','l','l','\n',0}; + static const WCHAR cont[] = {'c','o','n','t','a','i','n','s','\0','n','u','l','l','\n',0}; + + FILE *fp = fopen(file_name, "wb"); + wchar_t bufw[1024]; + char bufa[1024]; + int ret; + + ret = vfwprintf_wrapper(fp, simple); + ok(ret == 12, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 24, "ftell returned %d\n", ret); + + ret = vfwprintf_wrapper(fp, cont_fmt, '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 52, "ftell returned %d\n", ret); + + fclose(fp); + + fp = fopen(file_name, "rb"); + fgetws(bufw, ARRAY_SIZE(bufw), fp); + ret = ftell(fp); + ok(ret == 24, "ftell returned %d\n", ret); + ok(!wcscmp(bufw, simple), "buf = %s\n", wine_dbgstr_w(bufw)); + + fgetws(bufw, ARRAY_SIZE(bufw), fp); + ret = ftell(fp); + ok(ret == 52, "ret = %d\n", ret); + ok(!memcmp(bufw, cont, 28), "buf = %s\n", wine_dbgstr_w(bufw)); + + fclose(fp); + + fp = fopen(file_name, "wt"); + + ret = vfwprintf_wrapper(fp, simple); + ok(ret == 12, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + + ret = vfwprintf_wrapper(fp, cont_fmt, '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 28, "ftell returned %d\n", ret); + + fclose(fp); + + fp = fopen(file_name, "rb"); + fgets(bufa, sizeof(bufa), fp); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + ok(!strcmp(bufa, "simple test\r\n"), "buf = %s\n", bufa); + + fgets(bufa, sizeof(bufa), fp); + ret = ftell(fp); + ok(ret == 28, "ret = %d\n", ret); + ok(!memcmp(bufa, "contains\0null\r\n", 15), "buf = %s\n", bufa); + + fclose(fp); + unlink(file_name); + + /* NULL format */ + errno = 0xdeadbeef; + SET_EXPECT(invalid_parameter_handler); + ret = vfwprintf_wrapper(fp, NULL); + ok(errno == EINVAL, "expected errno EINVAL, got %d\n", errno); + ok(ret == -1, "expected ret -1, got %d\n", ret); + CHECK_CALLED(invalid_parameter_handler); + + /* NULL file */ + errno = 0xdeadbeef; + SET_EXPECT(invalid_parameter_handler); + ret = vfwprintf_wrapper(NULL, simple); + ok(errno == EINVAL, "expected errno EINVAL, got %d\n", errno); + ok(ret == -1, "expected ret -1, got %d\n", ret); + CHECK_CALLED(invalid_parameter_handler); + + /* format using % with NULL arglist*/ + /* crashes on Windows */ + /* ret = __stdio_common_vfwprintf(0, fp, cont_fmt, NULL, NULL); */ +} + +static int WINAPIV _vsnprintf_s_wrapper(char *str, size_t sizeOfBuffer, + size_t count, const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vsnprintf_s(0, str, sizeOfBuffer, count, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_vsnprintf_s(void) +{ + const char format[] = "AB%uC"; + const char out7[] = "AB123C"; + const char out6[] = "AB123"; + const char out2[] = "A"; + const char out1[] = ""; + char buffer[14] = { 0 }; + int exp, got; + + /* Enough room. */ + exp = strlen(out7); + + got = _vsnprintf_s_wrapper(buffer, 14, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 12, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 7, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + /* Not enough room. */ + exp = -1; + + got = _vsnprintf_s_wrapper(buffer, 6, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out6, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 2, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out2, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 1, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out1, buffer), "buffer wrong, got=%s\n", buffer); +} + +static int WINAPIV _vsnwprintf_s_wrapper(WCHAR *str, size_t sizeOfBuffer, + size_t count, const WCHAR *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vsnwprintf_s(0, str, sizeOfBuffer, count, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_vsnwprintf_s(void) +{ + const WCHAR format[] = {'A','B','%','u','C',0}; + const WCHAR out7[] = {'A','B','1','2','3','C',0}; + const WCHAR out6[] = {'A','B','1','2','3',0}; + const WCHAR out2[] = {'A',0}; + const WCHAR out1[] = {0}; + WCHAR buffer[14] = { 0 }; + int exp, got; + + /* Enough room. */ + exp = lstrlenW(out7); + + got = _vsnwprintf_s_wrapper(buffer, 14, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out7, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); + + got = _vsnwprintf_s_wrapper(buffer, 12, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out7, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); + + got = _vsnwprintf_s_wrapper(buffer, 7, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out7, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); + + /* Not enough room. */ + exp = -1; + + got = _vsnwprintf_s_wrapper(buffer, 6, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out6, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); + + got = _vsnwprintf_s_wrapper(buffer, 2, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out2, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); + + got = _vsnwprintf_s_wrapper(buffer, 1, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !lstrcmpW(out1, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); +} + +static void test_printf_legacy_wide(void) +{ + const wchar_t wide[] = {'A','B','C','D',0}; + const char narrow[] = "abcd"; + const char out[] = "abcd ABCD"; + /* The legacy wide flag doesn't affect narrow printfs, so the same + * format should behave the same both with and without the flag. */ + const char narrow_fmt[] = "%s %ls"; + /* The standard behaviour is to use the same format as for the narrow + * case, while the legacy case has got a different meaning for %s. */ + const wchar_t std_wide_fmt[] = {'%','s',' ','%','l','s',0}; + const wchar_t legacy_wide_fmt[] = {'%','h','s',' ','%','s',0}; + char buffer[20]; + wchar_t wbuffer[20]; + + vsprintf_wrapper(0, buffer, sizeof(buffer), narrow_fmt, narrow, wide); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS, buffer, sizeof(buffer), narrow_fmt, narrow, wide); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + + vswprintf_wrapper(0, wbuffer, sizeof(wbuffer), std_wide_fmt, narrow, wide); + WideCharToMultiByte(CP_ACP, 0, wbuffer, -1, buffer, sizeof(buffer), NULL, NULL); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + vswprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS, wbuffer, sizeof(wbuffer), legacy_wide_fmt, narrow, wide); + WideCharToMultiByte(CP_ACP, 0, wbuffer, -1, buffer, sizeof(buffer), NULL, NULL); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); +} + +static void test_printf_legacy_msvcrt(void) +{ + char buf[50]; + + /* In standard mode, %F is a float format conversion, while it is a + * length modifier in legacy msvcrt mode. In legacy mode, N is also + * a length modifier. */ + vsprintf_wrapper(0, buf, sizeof(buf), "%F", 1.23); + ok(!strcmp(buf, "1.230000"), "buf = %s\n", buf); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%Fd %Nd", 123, 456); + ok(!strcmp(buf, "123 456"), "buf = %s\n", buf); + + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F %f %e %E %g %G", INFINITY, INFINITY, -INFINITY, INFINITY, INFINITY, INFINITY, INFINITY); + ok(!strcmp(buf, "inf INF -inf inf INF inf INF"), "buf = %s\n", buf); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", INFINITY); + ok(!strcmp(buf, "1.#INF00"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F", NAN, NAN); + ok(!strcmp(buf, "nan NAN"), "buf = %s\n", buf); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", NAN); + ok(!strcmp(buf, "1.#QNAN0"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F", IND, IND); + ok(!strcmp(buf, "-nan(ind) -NAN(IND)"), "buf = %s\n", buf); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", IND); + ok(!strcmp(buf, "-1.#IND00"), "buf = %s\n", buf); +} + +static void test_printf_legacy_three_digit_exp(void) +{ + char buf[20]; + + vsprintf_wrapper(0, buf, sizeof(buf), "%E", 1.23); + ok(!strcmp(buf, "1.230000E+00"), "buf = %s\n", buf); + vsprintf_wrapper(_CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS, buf, sizeof(buf), "%E", 1.23); + ok(!strcmp(buf, "1.230000E+000"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%E", 1.23e+123); + ok(!strcmp(buf, "1.230000E+123"), "buf = %s\n", buf); +} + +static void test_printf_c99(void) +{ + char buf[30]; + int i; + + /* The msvcrt compatibility flag doesn't affect whether 'z' is interpreted + * as size_t size for integers. */ + for (i = 0; i < 2; i++) { + unsigned __int64 options = (i == 0) ? 0 : + _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY; + + /* z modifier accepts size_t argument */ + vsprintf_wrapper(options, buf, sizeof(buf), "%zx %d", SIZE_MAX, 1); + if (sizeof(size_t) == 8) + ok(!strcmp(buf, "ffffffffffffffff 1"), "buf = %s\n", buf); + else + ok(!strcmp(buf, "ffffffff 1"), "buf = %s\n", buf); + + /* j modifier with signed format accepts intmax_t argument */ + vsprintf_wrapper(options, buf, sizeof(buf), "%jd %d", INTMAX_MIN, 1); + ok(!strcmp(buf, "-9223372036854775808 1"), "buf = %s\n", buf); + + /* j modifier with unsigned format accepts uintmax_t argument */ + vsprintf_wrapper(options, buf, sizeof(buf), "%ju %d", UINTMAX_MAX, 1); + ok(!strcmp(buf, "18446744073709551615 1"), "buf = %s\n", buf); + + /* t modifier accepts ptrdiff_t argument */ + vsprintf_wrapper(options, buf, sizeof(buf), "%td %d", PTRDIFF_MIN, 1); + if (sizeof(ptrdiff_t) == 8) + ok(!strcmp(buf, "-9223372036854775808 1"), "buf = %s\n", buf); + else + ok(!strcmp(buf, "-2147483648 1"), "buf = %s\n", buf); + } +} + +static void test_printf_natural_string(void) +{ + const wchar_t wide[] = {'A','B','C','D',0}; + const char narrow[] = "abcd"; + const char narrow_fmt[] = "%s %Ts"; + const char narrow_out[] = "abcd abcd"; + const wchar_t wide_fmt[] = {'%','s',' ','%','T','s',0}; + const wchar_t wide_out[] = {'a','b','c','d',' ','A','B','C','D',0}; + char buffer[20]; + wchar_t wbuffer[20]; + + vsprintf_wrapper(0, buffer, sizeof(buffer), narrow_fmt, narrow, narrow); + ok(!strcmp(buffer, narrow_out), "buffer wrong, got=%s\n", buffer); + + vswprintf_wrapper(0, wbuffer, sizeof(wbuffer), wide_fmt, narrow, wide); + ok(!lstrcmpW(wbuffer, wide_out), "buffer wrong, got=%s\n", wine_dbgstr_w(wbuffer)); +} + +static void test_printf_fp(void) +{ + static const int flags[] = { + 0, + _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, + _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS, + _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY + | _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS, + _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY + | _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS + | _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING + }; + const struct { + const char *fmt; + double d; + const char *res[ARRAY_SIZE(flags)]; + const char *broken[ARRAY_SIZE(flags)]; + } tests[] = { + { "%a", NAN, { "nan", "0x1.#QNAN00000000p+0", "nan", "0x1.#QNAN00000000p+0" }}, + { "%A", NAN, { "NAN", "0X1.#QNAN00000000P+0", "NAN", "0X1.#QNAN00000000P+0" }}, + { "%e", NAN, { "nan", "1.#QNAN0e+00", "nan", "1.#QNAN0e+000" }}, + { "%E", NAN, { "NAN", "1.#QNAN0E+00", "NAN", "1.#QNAN0E+000" }}, + { "%g", NAN, { "nan", "1.#QNAN", "nan", "1.#QNAN" }}, + { "%G", NAN, { "NAN", "1.#QNAN", "NAN", "1.#QNAN" }}, + { "%21a", NAN, { " nan", " 0x1.#QNAN00000000p+0", " nan", " 0x1.#QNAN00000000p+0" }}, + { "%20e", NAN, { " nan", " 1.#QNAN0e+00", " nan", " 1.#QNAN0e+000" }}, + { "%20g", NAN, { " nan", " 1.#QNAN", " nan", " 1.#QNAN" }}, + { "%.21a", NAN, { "nan", "0x1.#QNAN0000000000000000p+0", "nan", "0x1.#QNAN0000000000000000p+0" }}, + { "%.20e", NAN, { "nan", "1.#QNAN000000000000000e+00", "nan", "1.#QNAN000000000000000e+000" }}, + { "%.20g", NAN, { "nan", "1.#QNAN", "nan", "1.#QNAN" }}, + { "%.021a", NAN, { "nan", "0x1.#QNAN0000000000000000p+0", "nan", "0x1.#QNAN0000000000000000p+0" }}, + { "%.020e", NAN, { "nan", "1.#QNAN000000000000000e+00", "nan", "1.#QNAN000000000000000e+000" }}, + { "%.020g", NAN, { "nan", "1.#QNAN", "nan", "1.#QNAN" }}, + { "%#.21a", NAN, { "nan", "0x1.#QNAN0000000000000000p+0", "nan", "0x1.#QNAN0000000000000000p+0" }}, + { "%#.20e", NAN, { "nan", "1.#QNAN000000000000000e+00", "nan", "1.#QNAN000000000000000e+000" }}, + { "%#.20g", NAN, { "nan", "1.#QNAN00000000000000", "nan", "1.#QNAN00000000000000" }}, + { "%.1g", NAN, { "nan", "1", "nan", "1" }}, + { "%.2g", NAN, { "nan", "1.$", "nan", "1.$" }}, + { "%.3g", NAN, { "nan", "1.#R", "nan", "1.#R" }}, + + { "%a", IND, { "-nan(ind)", "-0x1.#IND000000000p+0", "-nan(ind)", "-0x1.#IND000000000p+0" }}, + { "%e", IND, { "-nan(ind)", "-1.#IND00e+00", "-nan(ind)", "-1.#IND00e+000" }}, + { "%g", IND, { "-nan(ind)", "-1.#IND", "-nan(ind)", "-1.#IND" }}, + { "%21a", IND, { " -nan(ind)", "-0x1.#IND000000000p+0", " -nan(ind)", "-0x1.#IND000000000p+0" }}, + { "%20e", IND, { " -nan(ind)", " -1.#IND00e+00", " -nan(ind)", " -1.#IND00e+000" }}, + { "%20g", IND, { " -nan(ind)", " -1.#IND", " -nan(ind)", " -1.#IND" }}, + { "%.21a", IND, { "-nan(ind)", "-0x1.#IND00000000000000000p+0", "-nan(ind)", "-0x1.#IND00000000000000000p+0" }}, + { "%.20e", IND, { "-nan(ind)", "-1.#IND0000000000000000e+00", "-nan(ind)", "-1.#IND0000000000000000e+000" }}, + { "%.20g", IND, { "-nan(ind)", "-1.#IND", "-nan(ind)", "-1.#IND" }}, + { "%.021a", IND, { "-nan(ind)", "-0x1.#IND00000000000000000p+0", "-nan(ind)", "-0x1.#IND00000000000000000p+0" }}, + { "%.020e", IND, { "-nan(ind)", "-1.#IND0000000000000000e+00", "-nan(ind)", "-1.#IND0000000000000000e+000" }}, + { "%.020g", IND, { "-nan(ind)", "-1.#IND", "-nan(ind)", "-1.#IND" }}, + { "%#.21a", IND, { "-nan(ind)", "-0x1.#IND00000000000000000p+0", "-nan(ind)", "-0x1.#IND00000000000000000p+0" }}, + { "%#.20e", IND, { "-nan(ind)", "-1.#IND0000000000000000e+00", "-nan(ind)", "-1.#IND0000000000000000e+000" }}, + { "%#.20g", IND, { "-nan(ind)", "-1.#IND000000000000000", "-nan(ind)", "-1.#IND000000000000000" }}, + + { "%a", INFINITY, { "inf", "0x1.#INF000000000p+0", "inf", "0x1.#INF000000000p+0" }}, + { "%e", INFINITY, { "inf", "1.#INF00e+00", "inf", "1.#INF00e+000" }}, + { "%g", INFINITY, { "inf", "1.#INF", "inf", "1.#INF" }}, + { "%21a", INFINITY, { " inf", " 0x1.#INF000000000p+0", " inf", " 0x1.#INF000000000p+0" }}, + { "%20e", INFINITY, { " inf", " 1.#INF00e+00", " inf", " 1.#INF00e+000" }}, + { "%20g", INFINITY, { " inf", " 1.#INF", " inf", " 1.#INF" }}, + { "%.21a", INFINITY, { "inf", "0x1.#INF00000000000000000p+0", "inf", "0x1.#INF00000000000000000p+0" }}, + { "%.20e", INFINITY, { "inf", "1.#INF0000000000000000e+00", "inf", "1.#INF0000000000000000e+000" }}, + { "%.20g", INFINITY, { "inf", "1.#INF", "inf", "1.#INF" }}, + { "%.021a", INFINITY, { "inf", "0x1.#INF00000000000000000p+0", "inf", "0x1.#INF00000000000000000p+0" }}, + { "%.020e", INFINITY, { "inf", "1.#INF0000000000000000e+00", "inf", "1.#INF0000000000000000e+000" }}, + { "%.020g", INFINITY, { "inf", "1.#INF", "inf", "1.#INF" }}, + { "%#.21a", INFINITY, { "inf", "0x1.#INF00000000000000000p+0", "inf", "0x1.#INF00000000000000000p+0" }}, + { "%#.20e", INFINITY, { "inf", "1.#INF0000000000000000e+00", "inf", "1.#INF0000000000000000e+000" }}, + { "%#.20g", INFINITY, { "inf", "1.#INF000000000000000", "inf", "1.#INF000000000000000" }}, + + { "%a", -INFINITY, { "-inf", "-0x1.#INF000000000p+0", "-inf", "-0x1.#INF000000000p+0" }}, + { "%e", -INFINITY, { "-inf", "-1.#INF00e+00", "-inf", "-1.#INF00e+000" }}, + { "%g", -INFINITY, { "-inf", "-1.#INF", "-inf", "-1.#INF" }}, + { "%21a", -INFINITY, { " -inf", "-0x1.#INF000000000p+0", " -inf", "-0x1.#INF000000000p+0" }}, + { "%20e", -INFINITY, { " -inf", " -1.#INF00e+00", " -inf", " -1.#INF00e+000" }}, + { "%20g", -INFINITY, { " -inf", " -1.#INF", " -inf", " -1.#INF" }}, + { "%.21a", -INFINITY, { "-inf", "-0x1.#INF00000000000000000p+0", "-inf", "-0x1.#INF00000000000000000p+0" }}, + { "%.20e", -INFINITY, { "-inf", "-1.#INF0000000000000000e+00", "-inf", "-1.#INF0000000000000000e+000" }}, + { "%.20g", -INFINITY, { "-inf", "-1.#INF", "-inf", "-1.#INF" }}, + { "%.021a", -INFINITY, { "-inf", "-0x1.#INF00000000000000000p+0", "-inf", "-0x1.#INF00000000000000000p+0" }}, + { "%.020e", -INFINITY, { "-inf", "-1.#INF0000000000000000e+00", "-inf", "-1.#INF0000000000000000e+000" }}, + { "%.020g", -INFINITY, { "-inf", "-1.#INF", "-inf", "-1.#INF" }}, + { "%#.21a", -INFINITY, { "-inf", "-0x1.#INF00000000000000000p+0", "-inf", "-0x1.#INF00000000000000000p+0" }}, + { "%#.20e", -INFINITY, { "-inf", "-1.#INF0000000000000000e+00", "-inf", "-1.#INF0000000000000000e+000" }}, + { "%#.20g", -INFINITY, { "-inf", "-1.#INF000000000000000", "-inf", "-1.#INF000000000000000" }}, + + { "%a", 0, { "0x0.0000000000000p+0" }}, + { "%A", 0, { "0X0.0000000000000P+0" }}, + { "%a", 0.5, { "0x1.0000000000000p-1" }}, + { "%a", 1, { "0x1.0000000000000p+0" }}, + { "%a", 20, { "0x1.4000000000000p+4" }}, + { "%a", -1, { "-0x1.0000000000000p+0" }}, + { "%a", 0.1, { "0x1.999999999999ap-4" }}, + { "%24a", 0.1, { " 0x1.999999999999ap-4" }}, + { "%024a", 0.1, { "0x00001.999999999999ap-4" }}, + { "%.2a", 0.1, { "0x1.9ap-4" }}, + { "%.20a", 0.1, { "0x1.999999999999a0000000p-4" }}, + { "%.a", 0.1e-20, { "0x1p-70" }}, + { "%a", 0.1e-20, { "0x1.2e3b40a0e9b4fp-70" }}, + { "%a", 4.9406564584124654e-324, { "0x0.0000000000001p-1022" }}, + { "%.0a", -1.5, { "-0x2p+0" }, { "-0x1p+0" }}, + { "%.0a", -0.5, { "-0x1p-1" }}, + { "%.0a", 0.5, { "0x1p-1" }}, + { "%.0a", 1.5, { "0x2p+0" }, { "0x1p+0" }}, + { "%.0a", 1.99, { "0x2p+0" }}, + { "%.0a", 2, { "0x1p+1" }}, + { "%.0a", 9.5, { "0x1p+3" }}, + { "%.0a", 10.5, { "0x1p+3" }}, + { "%#.0a", -1.5, { "-0x2.p+0" }, { "-0x1.p+0" }}, + { "%#.0a", -0.5, { "-0x1.p-1" }}, + { "%#.0a", 0.5, { "0x1.p-1" }}, + { "%#.0a", 1.5, { "0x2.p+0" }, { "0x1.p+0" }}, + { "%#.1a", 1.03125, { "0x1.1p+0", NULL, NULL, NULL, "0x1.0p+0" }, { "0x1.0p+0" }}, + { "%#.1a", 1.09375, { "0x1.2p+0" }, { "0x1.1p+0" }}, + { "%#.1a", 1.15625, { "0x1.3p+0", NULL, NULL, NULL, "0x1.2p+0" }, { "0x1.2p+0" }}, + + { "%f", 0, { "0.000000" }}, + { "%e", 0, { "0.000000e+00", NULL, "0.000000e+000" }}, + { "%g", 0, { "0" }}, + { "%21f", 0, { " 0.000000" }}, + { "%20e", 0, { " 0.000000e+00", NULL, " 0.000000e+000" }}, + { "%20g", 0, { " 0" }}, + { "%.21f", 0, { "0.000000000000000000000" }}, + { "%.20e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%.20g", 0, { "0" }}, + { "%.021f", 0, { "0.000000000000000000000" }}, + { "%.020e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%.020g", 0, { "0" }}, + { "%#.21f", 0, { "0.000000000000000000000" }}, + { "%#.20e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%#.20g", 0, { "0.0000000000000000000" }, { "0.00000000000000000000" }}, + + { "%f", 123, { "123.000000" }}, + { "%e", 123, { "1.230000e+02", NULL, "1.230000e+002" }}, + { "%g", 123, { "123" }}, + { "%21f", 123, { " 123.000000" }}, + { "%20e", 123, { " 1.230000e+02", NULL, " 1.230000e+002" }}, + { "%20g", 123, { " 123" }}, + { "%.21f", 123, { "123.000000000000000000000" }}, + { "%.20e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%.20g", 123, { "123" }}, + { "%.021f", 123, { "123.000000000000000000000" }}, + { "%.020e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%.020g", 123, { "123" }}, + { "%#.21f", 123, { "123.000000000000000000000" }}, + { "%#.20e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%#.20g", 123, { "123.00000000000000000" }}, + + { "%f", -765, { "-765.000000" }}, + { "%e", -765, { "-7.650000e+02", NULL, "-7.650000e+002" }}, + { "%g", -765, { "-765" }}, + { "%21f", -765, { " -765.000000" }}, + { "%20e", -765, { " -7.650000e+02", NULL, " -7.650000e+002" }}, + { "%20g", -765, { " -765" }}, + { "%.21f", -765, { "-765.000000000000000000000" }}, + { "%.20e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%.20g", -765, { "-765" }}, + { "%.021f", -765, { "-765.000000000000000000000" }}, + { "%.020e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%.020g", -765, { "-765" }}, + { "%#.21f", -765, { "-765.000000000000000000000" }}, + { "%#.20e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%#.20g", -765, { "-765.00000000000000000" }}, + { "%.30f", 1.0/3.0, { "0.333333333333333314829616256247" }}, + { "%.30lf", sqrt(2), { "1.414213562373095145474621858739" }}, + { "%.0g", 9.8949714229143402e-05, { "0.0001" }}, + { "%.0f", 0.5, { "1", NULL, NULL, NULL, "0" }, {NULL, NULL, NULL, NULL, "1" }}, + { "%.0f", 1.5, { "2" }}, + { "%.0f", 2.5, { "3", NULL, NULL, NULL, "2" }, {NULL, NULL, NULL, NULL, "3" }}, + }; + + const char *res = NULL; + const char *broken_res; + char buf[100]; + int i, j, r; + + for (i = 0; i < ARRAY_SIZE(tests); i++) + { + broken_res = NULL; + + for (j = 0; j < ARRAY_SIZE(flags); j++) + { + if (tests[i].res[j]) res = tests[i].res[j]; + if (tests[i].broken[j]) broken_res = tests[i].broken[j]; + + r = vsprintf_wrapper(flags[j], buf, sizeof(buf), tests[i].fmt, tests[i].d); + ok(r == strlen(res) || broken(broken_res && r == strlen(broken_res)), + "%d,%d) r = %d, expected %d\n", i, j, r, strlen(res)); + ok(!strcmp(buf, res) || broken(broken_res && !strcmp(buf, broken_res)), + "%d,%d) buf = %s, expected %s\n", i, j, buf, res); + } + } +} + +START_TEST(printf) +{ + ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, + "Invalid parameter handler was already set\n"); + + test_snprintf(); + test_swprintf(); + test_fprintf(); + test_fwprintf(); + test_vsnprintf_s(); + test_vsnwprintf_s(); + test_printf_legacy_wide(); + test_printf_legacy_msvcrt(); + test_printf_legacy_three_digit_exp(); + test_printf_c99(); + test_printf_natural_string(); + test_printf_fp(); +} diff --git a/wrappers/new-dlls/ucrtbase/tests/scanf.c b/wrappers/new-dlls/ucrtbase/tests/scanf.c new file mode 100644 index 00000000000..2d469d2b04a --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/scanf.c @@ -0,0 +1,298 @@ +/* + * Conformance tests for *scanf functions. + * + * Copyright 2002 Uwe Bonnes + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "wine/test.h" + +static int WINAPIV vsscanf_wrapper(unsigned __int64 options, const char *str, size_t len, const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = __stdio_common_vsscanf(options, str, len, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_sscanf(void) +{ + static const float float1 = -82.6267f, float2 = 27.76f; + char buffer[100], buffer1[100]; + int result, ret, hour, min, count; + LONGLONG result64; + char c; + void *ptr; + float ret_float1, ret_float2; + double double_res; + unsigned int i; + + static const unsigned int tests[] = + { + 0, + _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS, + _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY, + }; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + ret = vsscanf_wrapper(tests[i], "", -1, "%d", &result); + ok(ret == EOF, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "000000000046F170", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)0x46f170, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0046F171", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)0x46f171, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "46F172", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)0x46f172, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0x46F173", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + todo_wine ok(ptr == (void *)0x46f173, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "-46F174", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)(ULONG_PTR)-0x46f174, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "+46F175", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)0x46f175, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1233", -1, "%p", &ptr); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ptr == (void *)0x1233, "sscanf reads %p for flags %#x\n", ptr, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1234", -1, "%P", &ptr); + todo_wine ok(ret == 0, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0x519", -1, "%x", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 0x519, "sscanf reads %#x for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0x51a", -1, "%x", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 0x51a, "sscanf reads %#x for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0x51g", -1, "%x", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 0x51, "sscanf reads %#x for flags %#x\n", result, tests[i]); + + result = 0; + ret = vsscanf_wrapper(tests[i], "-1", -1, "%x", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == -1, "sscanf reads %#x for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "\"%12@", -1, "%\"%%%d%@", &result); + todo_wine ok(ret == 0, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + sprintf(buffer, "%f %f", float1, float2); + ret = vsscanf_wrapper(tests[i], buffer, -1, "%f%f", &ret_float1, &ret_float2); + ok(ret == 2, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(ret_float1 == float1, "got wrong float %.8e for flags %#x\n", ret_float1, tests[i]); + ok(ret_float2 == float2, "got wrong float %.8e for flags %#x\n", ret_float2, tests[i]); + + sprintf(buffer, "%lf", 32.715); + ret = vsscanf_wrapper(tests[i], buffer, -1, "%lf", &double_res); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 32.715, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ret = vsscanf_wrapper(tests[i], buffer, -1, "%Lf", &double_res); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 32.715, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1.1e-30", -1, "%lf", &double_res); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 1.1e-30, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + + ret = vsscanf_wrapper(tests[i], " Waverly", -1, "%*c%[^\n]", buffer); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(!strcmp(buffer, " Waverly"), "got string '%s' for flags %#x\n", buffer, tests[i]); + + ret = vsscanf_wrapper(tests[i], "abcefgdh", -1, "%*[a-cg-e]%c", &buffer[0]); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(buffer[0] == 'd', "got char '%c' for flags %#x\n", buffer[0], tests[i]); + + ret = vsscanf_wrapper(tests[i], "abcefgdh", -1, "%*[a-cd-dg-e]%c", &buffer[0]); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(buffer[0] == 'h', "got char '%c' for flags %#x\n", buffer[0], tests[i]); + + strcpy(buffer, "foo"); + strcpy(buffer1, "bar"); + ret = vsscanf_wrapper(tests[i], "a", -1, "%s%s", buffer, buffer1); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(!strcmp(buffer, "a"), "got string '%s' for flags %#x\n", buffer, tests[i]); + ok(!strcmp(buffer1, "bar"), "got string '%s' for flags %#x\n", buffer1, tests[i]); + + ret = vsscanf_wrapper(tests[i], "21:59:20", -1, "%d%n", &result, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 21, "got wrong number %d for flags %#x\n", result, tests[i]); + ok(count == 2, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], ":59:20", -1, "%*c%n", &count); + ok(ret == 0, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(count == 1, "got wrong count %d for flags %#x\n", count, tests[i]); + + result = 0xdeadbeef; + ret = vsscanf_wrapper(tests[i], "12345678", -1, "%hd", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 0xdead614e, "got wrong number %#x for flags %#x\n", result, tests[i]); + + result = 0xdeadbeef; + ret = vsscanf_wrapper(tests[i], "12345678", -1, "%hhd", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 0xdeadbe4e, "got wrong number %#x for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "12345678901234", -1, "%lld", &result64); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result64 == 12345678901234, "got wrong number 0x%s for flags %#x\n", + wine_dbgstr_longlong(result64), tests[i]); + + ret = vsscanf_wrapper(tests[i], "123", -1, "%i", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 123, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "-1", -1, "%i", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == -1, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "123", -1, "%d", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 123, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "-1", -1, "%d", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == -1, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "017", -1, "%i", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 15, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0x17", -1, "%i", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == 23, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = vsscanf_wrapper(tests[i], "-1", -1, "%o", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == -1, "got wrong number %d for flags %#x\n", result, tests[i]); + + ret = 0xdeadbeef; + ret = vsscanf_wrapper(tests[i], "-1", -1, "%u", &result); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(result == -1, "got wrong number %d for flags %#x\n", result, tests[i]); + + c = 0x55; + ret = vsscanf_wrapper(tests[i], "a", -1, "%c", &c); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(c == 'a', "got wrong char '%c' for flags %#x\n", c, tests[i]); + + c = 0x55; + ret = vsscanf_wrapper(tests[i], " a", -1, "%c", &c); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(c == ' ', "got wrong char '%c' for flags %#x\n", c, tests[i]); + + c = 0x55; + ret = vsscanf_wrapper(tests[i], "18:59", -1, "%d:%d%c", &hour, &min, &c); + ok(ret == 2, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(hour == 18, "got wrong char '%c' for flags %#x\n", hour, tests[i]); + ok(min == 59, "got wrong char '%c' for flags %#x\n", min, tests[i]); + ok(c == 0x55, "got wrong char '%c' for flags %#x\n", c, tests[i]); + + strcpy(buffer, "foo"); + strcpy(buffer1, "bar"); + ret = vsscanf_wrapper(tests[i], "abc def", -1, "%s %n%s", buffer, &count, buffer1); + ok(ret == 2, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(!strcmp(buffer, "abc"), "got wrong string '%s' for flags %#x\n", buffer, tests[i]); + ok(count == 6, "got wrong count %d for flags %#x\n", count, tests[i]); + ok(!strcmp(buffer1, "def"), "got wrong string '%s' for flags %#x\n", buffer1, tests[i]); + + ret = vsscanf_wrapper(tests[i], "3:45", -1, "%d:%d%n", &hour, &min, &count); + ok(ret == 2, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(hour == 3, "got wrong char '%c' for flags %#x\n", hour, tests[i]); + ok(min == 45, "got wrong char '%c' for flags %#x\n", min, tests[i]); + ok(count == 4, "got wrong count %d for flags %#x\n", count, tests[i]); + + strcpy(buffer, "foo"); + strcpy(buffer1, "bar"); + ret = vsscanf_wrapper(tests[i], "test=value\xda", -1, "%[^=] = %[^;]", buffer, buffer1); + ok(ret == 2, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(!strcmp(buffer, "test"), "got wrong string '%s' for flags %#x\n", buffer, tests[i]); + ok(!strcmp(buffer1, "value\xda"), "got wrong string '%s' for flags %#x\n", buffer1, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0.1", 3, "%lf%n", &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 0.1, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ok(count == 3, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], "a", -1, "%lf%n", &double_res, &count); + ok(ret == 0, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "aa", -1, "%c%lf%n", &c, &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "a0e", -1, "%c%lf%n", &c, &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0.", -1, "%lf%n", &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 0, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ok(count == 2, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], "0.", 2, "%lf%n", &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == 0, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ok(count == 2, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1e", -1, "%lf%n", &double_res, &count); + ok(ret == -1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1e ", 2, "%lf%n", &double_res, &count); + ok(ret == -1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "1e+", -1, "%lf%n", &double_res, &count); + ok(ret == -1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + + ret = vsscanf_wrapper(tests[i], "inf", -1, "%lf%n", &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == INFINITY, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ok(count == 3, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], "infa", -1, "%lf%n", &double_res, &count); + ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + ok(double_res == INFINITY, "got wrong double %.16e for flags %#x\n", double_res, tests[i]); + ok(count == 3, "got wrong count %d for flags %#x\n", count, tests[i]); + + ret = vsscanf_wrapper(tests[i], "infi", -1, "%lf%n", &double_res, &count); + ok(ret == -1, "sscanf returned %d for flags %#x\n", ret, tests[i]); + } +} + +START_TEST(scanf) +{ + test_sscanf(); +} diff --git a/wrappers/new-dlls/ucrtbase/tests/string.c b/wrappers/new-dlls/ucrtbase/tests/string.c new file mode 100644 index 00000000000..1a4fbbd76f0 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/tests/string.c @@ -0,0 +1,552 @@ +/* + * Copyright 2015 Martin Storsjo + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "wine/test.h" + +#include + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(invalid_parameter_handler); + +static void __cdecl test_invalid_parameter_handler(const wchar_t *expression, + const wchar_t *function, const wchar_t *file, + unsigned line, uintptr_t arg) +{ + CHECK_EXPECT(invalid_parameter_handler); + ok(expression == NULL, "expression is not NULL\n"); + ok(function == NULL, "function is not NULL\n"); + ok(file == NULL, "file is not NULL\n"); + ok(line == 0, "line = %u\n", line); + ok(arg == 0, "arg = %lx\n", (UINT_PTR)arg); +} + +_ACRTIMP int __cdecl _o_tolower(int); +_ACRTIMP int __cdecl _o_toupper(int); + +static BOOL local_isnan(double d) +{ + return d != d; +} + +#define test_strtod_str_errno(string, value, length, err) _test_strtod_str(__LINE__, string, value, length, err) +#define test_strtod_str(string, value, length) _test_strtod_str(__LINE__, string, value, length, 0) +static void _test_strtod_str(int line, const char* string, double value, int length, int err) +{ + char *end; + double d; + errno = 0xdeadbeef; + d = strtod(string, &end); + if(!err) + ok_(__FILE__, line)(errno == 0xdeadbeef, "errno = %d\n", errno); + else + ok_(__FILE__, line)(errno == err, "errno = %d\n", errno); + if (local_isnan(value)) + ok_(__FILE__, line)(local_isnan(d), "d = %.16le (\"%s\")\n", d, string); + else + ok_(__FILE__, line)(d == value, "d = %.16le (\"%s\")\n", d, string); + ok_(__FILE__, line)(end == string + length, "incorrect end (%d, \"%s\")\n", (int)(end - string), string); +} + +static void test_strtod(void) +{ + test_strtod_str("infinity", INFINITY, 8); + test_strtod_str("INFINITY", INFINITY, 8); + test_strtod_str("InFiNiTy", INFINITY, 8); + test_strtod_str("INF", INFINITY, 3); + test_strtod_str("-inf", -INFINITY, 4); + test_strtod_str("inf42", INFINITY, 3); + test_strtod_str("inffoo", INFINITY, 3); + test_strtod_str("infini", INFINITY, 3); + test_strtod_str("input", 0, 0); + test_strtod_str("-input", 0, 0); + test_strtod_str_errno("1.7976931348623159e+308", INFINITY, 23, ERANGE); + test_strtod_str_errno("-1.7976931348623159e+308", -INFINITY, 24, ERANGE); + + test_strtod_str("NAN", NAN, 3); + test_strtod_str("nan", NAN, 3); + test_strtod_str("NaN", NAN, 3); + + test_strtod_str("0x42", 66, 4); + test_strtod_str("0X42", 66, 4); + test_strtod_str("-0x42", -66, 5); + test_strtod_str("0x1p1", 2, 5); + test_strtod_str("0x1P1", 2, 5); + test_strtod_str("0x1p+1", 2, 6); + test_strtod_str("0x2p-1", 1, 6); + test_strtod_str("0xA", 10, 3); + test_strtod_str("0xa", 10, 3); + test_strtod_str("0xABCDEF", 11259375, 8); + test_strtod_str("0Xabcdef", 11259375, 8); + + test_strtod_str("0x1.1", 1.0625, 5); + test_strtod_str("0x1.1p1", 2.125, 7); + test_strtod_str("0x1.A", 1.625, 5); + test_strtod_str("0x1p1a", 2, 5); + test_strtod_str("0xp3", 0, 1); + test_strtod_str("0x.", 0, 1); + test_strtod_str("0x.8", 0.5, 4); + test_strtod_str("0x.8p", 0.5, 4); + test_strtod_str("0x0p10000000000000000000000000", 0, 30); + test_strtod_str("0x1p-1026", 1.3906711615670009e-309, 9); + + test_strtod_str("0x1ffffffffffffe.80000000000000000000", 9007199254740990.0, 37); + test_strtod_str("0x1ffffffffffffe.80000000000000000001", 9007199254740991.0, 37); + test_strtod_str("0x1fffffffffffff.80000000000000000000", 9007199254740992.0, 37); + test_strtod_str("0x1fffffffffffff.80000000000000000001", 9007199254740992.0, 37); + + test_strtod_str("4.0621786324484881721115322e-53", 4.0621786324484881721115322e-53, 31); + test_strtod_str("1.8905590910042396899370942", 1.8905590910042396899370942, 27); + test_strtod_str("1.7976931348623158e+308", 1.7976931348623158e+308, 23); + test_strtod_str("2.2250738585072014e-308", 2.2250738585072014e-308, 23); + test_strtod_str("4.9406564584124654e-324", 4.9406564584124654e-324, 23); + test_strtod_str("2.48e-324", 4.9406564584124654e-324, 9); + test_strtod_str_errno("2.47e-324", 0, 9, ERANGE); +} + +static void test__memicmp(void) +{ + static const char *s1 = "abc"; + static const char *s2 = "aBd"; + int ret; + + ret = _memicmp(NULL, NULL, 0); + ok(!ret, "got %d\n", ret); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp(NULL, NULL, 1); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp(s1, NULL, 1); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp(NULL, s2, 1); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + ret = _memicmp(s1, s2, 2); + ok(!ret, "got %d\n", ret); + + ret = _memicmp(s1, s2, 3); + ok(ret == -1, "got %d\n", ret); +} + +static void test__memicmp_l(void) +{ + static const char *s1 = "abc"; + static const char *s2 = "aBd"; + int ret; + + ret = _memicmp_l(NULL, NULL, 0, NULL); + ok(!ret, "got %d\n", ret); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp_l(NULL, NULL, 1, NULL); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp_l(s1, NULL, 1, NULL); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _memicmp_l(NULL, s2, 1, NULL); + ok(ret == _NLSCMPERROR, "got %d\n", ret); + ok(errno == EINVAL, "Unexpected errno = %d\n", errno); + CHECK_CALLED(invalid_parameter_handler); + + ret = _memicmp_l(s1, s2, 2, NULL); + ok(!ret, "got %d\n", ret); + + ret = _memicmp_l(s1, s2, 3, NULL); + ok(ret == -1, "got %d\n", ret); +} + + +static void test___strncnt(void) +{ + static const struct + { + const char *str; + size_t size; + size_t ret; + } + strncnt_tests[] = + { + { "a", 0, 0 }, + { "a", 1, 1 }, + { "a", 10, 1 }, + { "abc", 1, 1 }, + }; + unsigned int i; + size_t ret; + + for (i = 0; i < ARRAY_SIZE(strncnt_tests); ++i) + { + ret = __strncnt(strncnt_tests[i].str, strncnt_tests[i].size); + ok(ret == strncnt_tests[i].ret, "%u: unexpected return value %u.\n", i, (int)ret); + } + + if (0) /* crashes */ + { + ret = __strncnt(NULL, 0); + ret = __strncnt(NULL, 1); + } +} + +static void test_C_locale(void) +{ + int i, j; + wint_t ret, exp; + _locale_t locale; + static const char *locales[] = { NULL, "C" }; + + /* C locale only converts case for [a-zA-Z] */ + setlocale(LC_ALL, "C"); + for (i = 0; i <= 0xffff; i++) + { + ret = tolower(i); + if (i >= 'A' && i <= 'Z') + { + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = _tolower(i); + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + + ret = _o_tolower(i); + if (i >= 'A' && i <= 'Z') + { + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = towlower(i); + if (i >= 'A' && i <= 'Z') + { + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = toupper(i); + if (i >= 'a' && i <= 'z') + { + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = _toupper(i); + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + + ret = _o_toupper(i); + if (i >= 'a' && i <= 'z') + { + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = towupper(i); + if (i >= 'a' && i <= 'z') + { + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + } + + for (i = 0; i < ARRAY_SIZE(locales); i++) { + locale = locales[i] ? _create_locale(LC_ALL, locales[i]) : NULL; + + for (j = 0; j <= 0xffff; j++) { + ret = _towlower_l(j, locale); + if (j >= 'A' && j <= 'Z') + { + exp = j + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == j, "expected self %x, got %x for C locale\n", j, ret); + + ret = _towupper_l(j, locale); + if (j >= 'a' && j <= 'z') + { + exp = j + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == j, "expected self %x, got %x for C locale\n", j, ret); + } + + _free_locale(locale); + } +} + +static void test_mbsspn( void) +{ + unsigned char str1[] = "cabernet"; + unsigned char str2[] = "shiraz"; + unsigned char set[] = "abc"; + unsigned char empty[] = ""; + unsigned char mbstr[] = " 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa"; + unsigned char mbset1[] = "0123456789 \x94\x4e"; + unsigned char mbset2[] = " \x94\x4e\x8c\x8e"; + unsigned char mbset3[] = "\x8e"; + int ret, cp = _getmbcp(); + + ret = _mbsspn(str1, set); + ok(ret == 3, "_mbsspn returns %d should be 3\n", ret); + ret = _mbsspn(str2, set); + ok(ret == 0, "_mbsspn returns %d should be 0\n", ret); + ret = _mbsspn(str1, empty); + ok(ret == 0, "_mbsspn returns %d should be 0\n", ret); + + _setmbcp(932); + ret = _mbsspn(mbstr, mbset1); + ok(ret == 8, "_mbsspn returns %d should be 8\n", ret); + ret = _mbsspn(mbstr, mbset2); + ok(ret == 1, "_mbsspn returns %d should be 1\n", ret); + ret = _mbsspn(mbstr+8, mbset1); + ok(ret == 0, "_mbsspn returns %d should be 0\n", ret); + ret = _mbsspn(mbstr+8, mbset2); + ok(ret == 2, "_mbsspn returns %d should be 2\n", ret); + ret = _mbsspn(mbstr, mbset3); + ok(ret == 14, "_mbsspn returns %d should be 14\n", ret); + + _setmbcp(cp); +} + +static void test_wcstok(void) +{ + static const wchar_t *input = L"two words"; + wchar_t buffer[16]; + wchar_t *token; + wchar_t *next; + + next = NULL; + wcscpy(buffer, input); + token = wcstok(buffer, L" ", &next); + ok(!wcscmp(L"two", token), "expected \"two\", got \"%ls\"\n", token); + ok(next == token + 4, "expected %p, got %p\n", token + 4, next); + token = wcstok(NULL, L" ", &next); + ok(!wcscmp(L"words", token), "expected \"words\", got \"%ls\"\n", token); + ok(next == token + 5, "expected %p, got %p\n", token + 5, next); + token = wcstok(NULL, L" ", &next); + ok(!token, "expected NULL, got %p\n", token); + + wcscpy(buffer, input); + token = wcstok(buffer, L" ", NULL); + ok(!wcscmp(L"two", token), "expected \"two\", got \"%ls\"\n", token); + token = wcstok(NULL, L" ", NULL); + ok(!wcscmp(L"words", token), "expected \"words\", got \"%ls\"\n", token); + token = wcstok(NULL, L" ", NULL); + ok(!token, "expected NULL, got %p\n", token); +} + +static void test__strnicmp(void) +{ + static const char str1[] = "TEST"; + static const char str2[] = "test"; + int ret; + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + ret = _strnicmp(str1, str2, -1); + todo_wine CHECK_CALLED(invalid_parameter_handler); + todo_wine ok(ret == _NLSCMPERROR, "got %d.\n", ret); + todo_wine ok(errno == EINVAL, "Unexpected errno %d.\n", errno); + + ret = _strnicmp(str1, str2, 0x7fffffff); + ok(!ret, "got %d.\n", ret); +} + +static void test_SpecialCasing(void) +{ + int i; + wint_t ret, exp; + _locale_t locale; + struct test { + const char *lang; + wint_t ch; + wint_t exp; + }; + + struct test ucases[] = { + {"English", 'I', 'i'}, /* LATIN CAPITAL LETTER I */ + {"English", 0x0130}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ + + {"Turkish", 'I', 'i'}, /* LATIN CAPITAL LETTER I */ + {"Turkish", 0x0130}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ + }; + struct test lcases[] = { + {"English", 'i', 'I'}, /* LATIN SMALL LETTER I */ + {"English", 0x0131}, /* LATIN SMALL LETTER DOTLESS I */ + + {"Turkish", 'i', 'I'}, /* LATIN SMALL LETTER I */ + {"Turkish", 0x0131}, /* LATIN SMALL LETTER DOTLESS I */ + }; + + for (i = 0; i < ARRAY_SIZE(ucases); i++) { + if (!setlocale(LC_ALL, ucases[i].lang)) { + win_skip("skipping special case tests for %s\n", ucases[i].lang); + continue; + } + + ret = towlower(ucases[i].ch); + exp = ucases[i].exp ? ucases[i].exp : ucases[i].ch; + ok(ret == exp, "expected lowercase %x, got %x for locale %s\n", exp, ret, ucases[i].lang); + } + + for (i = 0; i < ARRAY_SIZE(lcases); i++) { + if (!setlocale(LC_ALL, lcases[i].lang)) { + win_skip("skipping special case tests for %s\n", lcases[i].lang); + continue; + } + + ret = towupper(lcases[i].ch); + exp = lcases[i].exp ? lcases[i].exp : lcases[i].ch; + ok(ret == exp, "expected uppercase %x, got %x for locale %s\n", exp, ret, lcases[i].lang); + } + + setlocale(LC_ALL, "C"); + + /* test _towlower_l creating locale */ + for (i = 0; i < ARRAY_SIZE(ucases); i++) { + if (!(locale = _create_locale(LC_ALL, ucases[i].lang))) { + win_skip("locale %s not available. skipping\n", ucases[i].lang); + continue; + } + + ret = _towlower_l(ucases[i].ch, locale); + exp = ucases[i].exp ? ucases[i].exp : ucases[i].ch; + ok(ret == exp, "expected lowercase %x, got %x for locale %s\n", exp, ret, ucases[i].lang); + + _free_locale(locale); + } + + /* test _towupper_l creating locale */ + for (i = 0; i < ARRAY_SIZE(lcases); i++) { + if (!(locale = _create_locale(LC_ALL, lcases[i].lang))) { + win_skip("locale %s not available. skipping\n", lcases[i].lang); + continue; + } + + ret = _towupper_l(lcases[i].ch, locale); + exp = lcases[i].exp ? lcases[i].exp : lcases[i].ch; + ok(ret == exp, "expected uppercase %x, got %x for locale %s\n", exp, ret, lcases[i].lang); + + _free_locale(locale); + } +} + +static void test__mbbtype_l(void) +{ + int expected, ret; + unsigned int c; + + _setmbcp(_MB_CP_LOCALE); + for (c = 0; c < 256; ++c) + { + expected = _mbbtype(c, 0); + ret = _mbbtype_l(c, 0, NULL); + ok(ret == expected, "c %#x, got ret %#x, expected %#x.\n", c, ret, expected); + + expected = _mbbtype(c, 1); + ret = _mbbtype_l(c, 1, NULL); + ok(ret == expected, "c %#x, got ret %#x, expected %#x.\n", c, ret, expected); + } +} + +START_TEST(string) +{ + ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, + "Invalid parameter handler was already set\n"); + + test_strtod(); + test__memicmp(); + test__memicmp_l(); + test___strncnt(); + test_C_locale(); + test_mbsspn(); + test_wcstok(); + test__strnicmp(); + test_SpecialCasing(); + test__mbbtype_l(); +} diff --git a/wrappers/new-dlls/ucrtbase/ucrtbase.spec b/wrappers/new-dlls/ucrtbase/ucrtbase.spec new file mode 100644 index 00000000000..0a8d74521f5 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/ucrtbase.spec @@ -0,0 +1,2599 @@ +@ cdecl -arch=i386 _CIacos() +@ cdecl -arch=i386 _CIasin() +@ cdecl -arch=i386 _CIatan() +@ cdecl -arch=i386 _CIatan2() +@ cdecl -arch=i386 _CIcos() +@ cdecl -arch=i386 _CIcosh() +@ cdecl -arch=i386 _CIexp() +@ cdecl -arch=i386 _CIfmod() +@ cdecl -arch=i386 _CIlog() +@ cdecl -arch=i386 _CIlog10() +@ cdecl -arch=i386 _CIpow() +@ cdecl -arch=i386 _CIsin() +@ cdecl -arch=i386 _CIsinh() +@ cdecl -arch=i386 _CIsqrt() +@ cdecl -arch=i386 _CItan() +@ cdecl -arch=i386 _CItanh() +@ cdecl _Cbuild(ptr double double) +@ stub _Cmulcc +@ stub _Cmulcr +@ cdecl _CreateFrameInfo(ptr ptr) +@ stdcall _CxxThrowException(ptr ptr) +@ cdecl -arch=i386 -norelay _EH_prolog() +@ cdecl _Exit(long) _exit +@ stub _FCbuild +@ stub _FCmulcc +@ stub _FCmulcr +@ cdecl _FindAndUnlinkFrame(ptr) +@ stub _GetImageBase +@ stub _GetThrowImageBase +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ cdecl _IsExceptionObjectToBeDestroyed(ptr) +@ stub _LCbuild +@ stub _LCmulcc +@ stub _LCmulcr +@ stub _SetImageBase +@ stub _SetThrowImageBase +@ stub _NLG_Dispatch2 +@ stub _NLG_Return +@ stub _NLG_Return2 +@ cdecl _SetWinRTOutOfMemoryExceptionCallback(ptr) +@ cdecl _Strftime(ptr long str ptr ptr) +@ cdecl _W_Getdays() +@ cdecl _W_Getmonths() +@ cdecl _W_Gettnames() +@ cdecl _Wcsftime(ptr long wstr ptr ptr) +@ cdecl __AdjustPointer(ptr ptr) +@ stub __BuildCatchObject +@ stub __BuildCatchObjectHelper +@ stdcall -arch=x86_64,arm64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() +@ cdecl __CxxRegisterExceptionObject(ptr ptr) +@ cdecl __CxxUnregisterExceptionObject(ptr long) +@ cdecl __DestructExceptionObject(ptr) +@ stub __FrameUnwindFilter +@ stub __GetPlatformExceptionInfo +@ stub __NLG_Dispatch2 +@ stub __NLG_Return2 +@ cdecl __RTCastToVoid(ptr) +@ cdecl __RTDynamicCast(ptr long ptr ptr long) +@ cdecl __RTtypeid(ptr) +@ stub __TypeMatch +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_locale_name_func() +@ cdecl ___mb_cur_max_func() +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl __acrt_iob_func(long) +@ cdecl __conio_common_vcprintf(int64 str ptr ptr) +@ stub __conio_common_vcprintf_p +@ stub __conio_common_vcprintf_s +@ stub __conio_common_vcscanf +@ cdecl __conio_common_vcwprintf(int64 wstr ptr ptr) __conio_common_vcwprintf +@ stub __conio_common_vcwprintf_p +@ stub __conio_common_vcwprintf_s +@ stub __conio_common_vcwscanf +@ cdecl -arch=i386 __control87_2(long long ptr ptr) +@ cdecl __current_exception() +@ cdecl __current_exception_context() +@ cdecl __daylight() __p__daylight +@ stub __dcrt_get_wide_environment_from_os +@ stub __dcrt_initial_narrow_environment +@ cdecl __doserrno() +@ cdecl __dstbias() __p__dstbias +@ cdecl __fpe_flt_rounds() +@ cdecl __fpecode() +@ cdecl __initialize_lconv_for_unsigned_char() __lconv_init +@ cdecl __intrinsic_abnormal_termination() +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=x86_64,arm64 -norelay __intrinsic_setjmpex(ptr ptr) __wine_setjmpex +@ cdecl __isascii(long) +@ cdecl __iscsym(long) +@ cdecl __iscsymf(long) +@ stub __iswcsym +@ stub __iswcsymf +@ cdecl -arch=i386 -norelay __libm_sse2_acos() +@ cdecl -arch=i386 -norelay __libm_sse2_acosf() +@ cdecl -arch=i386 -norelay __libm_sse2_asin() +@ cdecl -arch=i386 -norelay __libm_sse2_asinf() +@ cdecl -arch=i386 -norelay __libm_sse2_atan() +@ cdecl -arch=i386 -norelay __libm_sse2_atan2() +@ cdecl -arch=i386 -norelay __libm_sse2_atanf() +@ cdecl -arch=i386 -norelay __libm_sse2_cos() +@ cdecl -arch=i386 -norelay __libm_sse2_cosf() +@ cdecl -arch=i386 -norelay __libm_sse2_exp() +@ cdecl -arch=i386 -norelay __libm_sse2_expf() +@ cdecl -arch=i386 -norelay __libm_sse2_log() +@ cdecl -arch=i386 -norelay __libm_sse2_log10() +@ cdecl -arch=i386 -norelay __libm_sse2_log10f() +@ cdecl -arch=i386 -norelay __libm_sse2_logf() +@ cdecl -arch=i386 -norelay __libm_sse2_pow() +@ cdecl -arch=i386 -norelay __libm_sse2_powf() +@ cdecl -arch=i386 -norelay __libm_sse2_sin() +@ cdecl -arch=i386 -norelay __libm_sse2_sinf() +@ cdecl -arch=i386 -norelay __libm_sse2_tan() +@ cdecl -arch=i386 -norelay __libm_sse2_tanf() +@ cdecl __p___argc() +@ cdecl __p___argv() +@ cdecl __p___wargv() +@ cdecl __p__acmdln() +@ cdecl __p__commode() +@ cdecl __p__environ() +@ cdecl __p__fmode() +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__pgmptr() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() +@ cdecl __p__wpgmptr() +@ cdecl __pctype_func() +@ cdecl __processing_throw() +@ cdecl __pwctype_func() +@ cdecl __pxcptinfoptrs() +@ stub __report_gsfailure +@ cdecl __setusermatherr(ptr) +@ cdecl __std_exception_copy(ptr ptr) +@ cdecl __std_exception_destroy(ptr) +@ cdecl __std_type_info_compare(ptr ptr) +@ cdecl __std_type_info_destroy_list(ptr) +@ cdecl __std_type_info_hash(ptr) +@ cdecl __std_type_info_name(ptr ptr) +@ cdecl __stdio_common_vfprintf(int64 ptr str ptr ptr) _stdio_common_vfprintf +@ stub __stdio_common_vfprintf_p +@ cdecl __stdio_common_vfprintf_s(int64 ptr str ptr ptr) +@ cdecl __stdio_common_vfscanf(int64 ptr str ptr ptr) +@ cdecl __stdio_common_vfwprintf(int64 ptr wstr ptr ptr) +@ stub __stdio_common_vfwprintf_p +@ cdecl __stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) +@ cdecl __stdio_common_vfwscanf(int64 ptr wstr ptr ptr) +@ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) +@ cdecl __stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) +@ cdecl -norelay __stdio_common_vsprintf(int64 ptr long str ptr ptr) +@ cdecl __stdio_common_vsprintf_p(int64 ptr long str ptr ptr) +@ cdecl __stdio_common_vsprintf_s(int64 ptr long str ptr ptr) +@ cdecl __stdio_common_vsscanf(int64 ptr long str ptr ptr) +@ cdecl __stdio_common_vswprintf(int64 ptr long wstr ptr ptr) +@ cdecl __stdio_common_vswprintf_p(int64 ptr long wstr ptr ptr) +@ cdecl __stdio_common_vswprintf_s(int64 ptr long wstr ptr ptr) +@ cdecl __stdio_common_vswscanf(int64 ptr long wstr ptr ptr) +@ cdecl __strncnt(str long) +@ cdecl __sys_errlist() +@ cdecl __sys_nerr() +@ cdecl __threadhandle() kernel32.GetCurrentThread +@ cdecl __threadid() kernel32.GetCurrentThreadId +@ cdecl __timezone() __p__timezone +@ cdecl __toascii(long) +@ cdecl __tzname() __p__tzname +@ cdecl __unDName(ptr str long ptr ptr long) +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) +@ cdecl __uncaught_exception() +@ cdecl __wcserror(wstr) +@ cdecl __wcserror_s(ptr long wstr) +@ stub __wcsncnt +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) +@ cdecl _access_s(str long) +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) +@ cdecl _aligned_msize(ptr long long) +@ cdecl _aligned_offset_malloc(long long long) +@ cdecl _aligned_offset_realloc(ptr long long long) +@ stub _aligned_offset_recalloc +@ cdecl _aligned_realloc(ptr long long) +@ stub _aligned_recalloc +@ cdecl _assert(str str long) +@ cdecl _atodbl(ptr str) +@ cdecl _atodbl_l(ptr str ptr) +@ cdecl _atof_l(str ptr) +@ cdecl _atoflt(ptr str) +@ cdecl _atoflt_l(ptr str ptr) +@ cdecl -ret64 _atoi64(str) +@ cdecl -ret64 _atoi64_l(str ptr) +@ cdecl _atoi_l(str ptr) +@ cdecl _atol_l(str ptr) +@ cdecl _atoldbl(ptr str) +@ cdecl _atoldbl_l(ptr str ptr) +@ cdecl -ret64 _atoll_l(str ptr) +@ cdecl _beep(long long) +@ cdecl _beginthread(ptr long ptr) +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) +@ cdecl _byteswap_uint64(int64) +@ cdecl _byteswap_ulong(long) +@ cdecl _byteswap_ushort(long) +@ cdecl _c_exit() +@ cdecl _cabs(long) +@ cdecl _callnewh(long) +@ cdecl _calloc_base(long long) +@ cdecl _cexit() +@ cdecl _cgets(ptr) +@ stub _cgets_s +@ stub _cgetws +@ stub _cgetws_s +@ cdecl _chdir(str) +@ cdecl _chdrive(long) +@ cdecl _chgsign(double) +@ cdecl _chgsignf(float) +@ cdecl -arch=i386 -norelay _chkesp() +@ cdecl _chmod(str long) +@ cdecl _chsize(long long) +@ cdecl _chsize_s(long int64) +@ cdecl _clearfp() +@ cdecl _close(long) +@ cdecl _commit(long) +@ cdecl _configthreadlocale(long) +@ cdecl _configure_narrow_argv(long) +@ cdecl _configure_wide_argv(long) +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) +@ cdecl _copysignf(float float) +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) +@ cdecl _create_locale(long str) +@ cdecl _crt_at_quick_exit(ptr) +@ cdecl _crt_atexit(ptr) +@ cdecl _crt_debugger_hook(long) +@ cdecl _ctime32(ptr) +@ cdecl _ctime32_s(str long ptr) +@ cdecl _ctime64(ptr) +@ cdecl _ctime64_s(str long ptr) +@ cdecl _cwait(ptr long long) +@ stub _d_int +@ cdecl _dclass(double) +@ stub _dexp +@ cdecl _difftime32(long long) +@ cdecl _difftime64(int64 int64) +@ stub _dlog +@ stub _dnorm +@ cdecl _dpcomp(double double) +@ stub _dpoly +@ stub _dscale +@ cdecl _dsign(double) +@ stub _dsin +@ cdecl _dtest(ptr) +@ stub _dunscale +@ cdecl _dup(long) +@ cdecl _dup2(long long) +@ cdecl _dupenv_s(ptr ptr str) +@ cdecl _ecvt(double long ptr ptr) +@ cdecl _ecvt_s(str long double long ptr ptr) +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ cdecl _eof(long) +@ cdecl _errno() +@ cdecl _except1(long long double double long ptr) +@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) +@ varargs _execl(str str) +@ varargs _execle(str str) +@ varargs _execlp(str str) +@ varargs _execlpe(str str) +@ cdecl _execute_onexit_table(ptr) +@ cdecl _execv(str ptr) +@ cdecl _execve(str ptr ptr) +@ cdecl _execvp(str ptr) +@ cdecl _execvpe(str ptr ptr) +@ cdecl _exit(long) +@ cdecl _expand(ptr long) +@ cdecl _fclose_nolock(ptr) +@ cdecl _fcloseall() +@ cdecl _fcvt(double long ptr ptr) +@ cdecl _fcvt_s(ptr long double long ptr ptr) +@ stub _fd_int +@ cdecl _fdclass(float) +@ stub _fdexp +@ stub _fdlog +@ stub _fdnorm +@ cdecl _fdopen(long str) +@ cdecl _fdpcomp(float float) +@ stub _fdpoly +@ stub _fdscale +@ cdecl _fdsign(float) +@ stub _fdsin +@ cdecl _fdtest(ptr) +@ stub _fdunscale +@ cdecl _fflush_nolock(ptr) +@ cdecl _fgetc_nolock(ptr) +@ cdecl _fgetchar() +@ cdecl _fgetwc_nolock(ptr) +@ cdecl _fgetwchar() +@ cdecl _filelength(long) +@ cdecl -ret64 _filelengthi64(long) +@ cdecl _fileno(ptr) +@ cdecl _findclose(long) +@ cdecl _findfirst32(str ptr) +@ stub _findfirst32i64 +@ cdecl _findfirst64(str ptr) +@ cdecl _findfirst64i32(str ptr) +@ cdecl _findnext32(long ptr) +@ stub _findnext32i64 +@ cdecl _findnext64(long ptr) +@ cdecl _findnext64i32(long ptr) +@ cdecl _finite(double) +@ cdecl -arch=!i386 _finitef(float) +@ cdecl _flushall() +@ cdecl _fpclass(double) +@ cdecl -arch=!i386 _fpclassf(float) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() +@ cdecl _fputc_nolock(long ptr) +@ cdecl _fputchar(long) +@ cdecl _fputwc_nolock(long ptr) +@ cdecl _fputwchar(long) +@ cdecl _fread_nolock(ptr long long ptr) +@ cdecl _fread_nolock_s(ptr long long long ptr) +@ cdecl _free_base(ptr) +@ cdecl _free_locale(ptr) +@ cdecl _fseek_nolock(ptr long long) +@ cdecl _fseeki64(ptr int64 long) +@ cdecl _fseeki64_nolock(ptr int64 long) +@ cdecl _fsopen(str str long) +@ cdecl _fstat32(long ptr) +@ cdecl _fstat32i64(long ptr) +@ cdecl _fstat64(long ptr) +@ cdecl _fstat64i32(long ptr) +@ cdecl _ftell_nolock(ptr) +@ cdecl -ret64 _ftelli64(ptr) +@ cdecl -ret64 _ftelli64_nolock(ptr) +@ cdecl _ftime32(ptr) +@ cdecl _ftime32_s(ptr) +@ cdecl _ftime64(ptr) +@ cdecl _ftime64_s(ptr) +@ cdecl -arch=i386 -ret64 _ftol() +@ cdecl _fullpath(ptr str long) +@ cdecl _futime32(long ptr) +@ cdecl _futime64(long ptr) +@ cdecl _fwrite_nolock(ptr long long ptr) +@ cdecl _gcvt(double long str) +@ cdecl _gcvt_s(ptr long double long) +@ cdecl -arch=win64 _get_FMA3_enable() +@ cdecl _get_current_locale() +@ cdecl _get_daylight(ptr) +@ cdecl _get_doserrno(ptr) +@ cdecl _get_dstbias(ptr) +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) +@ cdecl _get_heap_handle() +@ cdecl _get_initial_narrow_environment() +@ cdecl _get_initial_wide_environment() +@ cdecl _get_invalid_parameter_handler() +@ cdecl _get_narrow_winmain_command_line() +@ cdecl _get_osfhandle(long) +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() +@ cdecl _get_purecall_handler() +@ cdecl _get_stream_buffer_pointers(ptr ptr ptr ptr) +@ cdecl _get_terminate() +@ cdecl _get_thread_local_invalid_parameter_handler() +@ cdecl _get_timezone(ptr) +@ cdecl _get_tzname(ptr str long long) +@ cdecl _get_unexpected() +@ cdecl _get_wide_winmain_command_line() +@ cdecl _get_wpgmptr(ptr) +@ cdecl _getc_nolock(ptr) _fgetc_nolock +@ cdecl _getch() +@ cdecl _getch_nolock() +@ cdecl _getche() +@ cdecl _getche_nolock() +@ cdecl _getcwd(str long) +@ cdecl _getdcwd(long str long) +@ cdecl _getdiskfree(long ptr) +@ cdecl _getdllprocaddr(long str long) +@ cdecl _getdrive() +@ cdecl _getdrives() kernel32.GetLogicalDrives +@ cdecl _getmaxstdio() +@ cdecl _getmbcp() +@ cdecl _getpid() +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) +@ cdecl _getwc_nolock(ptr) _fgetwc_nolock +@ cdecl _getwch() +@ cdecl _getwch_nolock() +@ cdecl _getwche() +@ cdecl _getwche_nolock() +@ cdecl _getws(ptr) +@ stub _getws_s +@ cdecl -arch=i386 _global_unwind2(ptr) +@ cdecl _gmtime32(ptr) +@ cdecl _gmtime32_s(ptr ptr) +@ cdecl _gmtime64(ptr) +@ cdecl _gmtime64_s(ptr ptr) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapwalk(ptr) +@ cdecl _hypot(double double) +@ cdecl _hypotf(float float) +@ cdecl _i64toa(int64 ptr long) ntdll._i64toa +@ cdecl _i64toa_s(int64 ptr long long) +@ cdecl _i64tow(int64 ptr long) ntdll._i64tow +@ cdecl _i64tow_s(int64 ptr long long) +@ cdecl _initialize_narrow_environment() +@ cdecl _initialize_onexit_table(ptr) +@ cdecl _initialize_wide_environment() +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ cdecl _invalid_parameter_noinfo() +@ cdecl _invalid_parameter_noinfo_noreturn() +@ stub _invoke_watson +@ stub _is_exception_typeof +@ cdecl _isalnum_l(long ptr) +@ cdecl _isalpha_l(long ptr) +@ cdecl _isatty(long) +@ cdecl _isblank_l(long ptr) +@ cdecl _iscntrl_l(long ptr) +@ cdecl _isctype(long long) +@ cdecl _isctype_l(long long ptr) +@ cdecl _isdigit_l(long ptr) +@ cdecl _isgraph_l(long ptr) +@ cdecl _isleadbyte_l(long ptr) +@ cdecl _islower_l(long ptr) +@ stub _ismbbalnum(long) +@ stub _ismbbalnum_l +@ stub _ismbbalpha(long) +@ stub _ismbbalpha_l +@ stub _ismbbblank +@ stub _ismbbblank_l +@ stub _ismbbgraph(long) +@ stub _ismbbgraph_l +@ stub _ismbbkalnum(long) +@ stub _ismbbkalnum_l +@ cdecl _ismbbkana(long) +@ cdecl _ismbbkana_l(long ptr) +@ stub _ismbbkprint(long) +@ stub _ismbbkprint_l +@ stub _ismbbkpunct(long) +@ stub _ismbbkpunct_l +@ cdecl _ismbblead(long) +@ cdecl _ismbblead_l(long ptr) +@ stub _ismbbprint(long) +@ stub _ismbbprint_l +@ stub _ismbbpunct(long) +@ stub _ismbbpunct_l +@ cdecl _ismbbtrail(long) +@ cdecl _ismbbtrail_l(long ptr) +@ cdecl _ismbcalnum(long) +@ cdecl _ismbcalnum_l(long ptr) +@ cdecl _ismbcalpha(long) +@ cdecl _ismbcalpha_l(long ptr) +@ stub _ismbcblank +@ stub _ismbcblank_l +@ cdecl _ismbcdigit(long) +@ cdecl _ismbcdigit_l(long ptr) +@ cdecl _ismbcgraph(long) +@ cdecl _ismbcgraph_l(long ptr) +@ cdecl _ismbchira(long) +@ stub _ismbchira_l +@ cdecl _ismbckata(long) +@ stub _ismbckata_l +@ cdecl _ismbcl0(long) +@ cdecl _ismbcl0_l(long ptr) +@ cdecl _ismbcl1(long) +@ cdecl _ismbcl1_l(long ptr) +@ cdecl _ismbcl2(long) +@ cdecl _ismbcl2_l(long ptr) +@ cdecl _ismbclegal(long) +@ cdecl _ismbclegal_l(long ptr) +@ cdecl _ismbclower(long) +@ cdecl _ismbclower_l(long ptr) +@ cdecl _ismbcprint(long) +@ cdecl _ismbcprint_l(long ptr) +@ cdecl _ismbcpunct(long) +@ cdecl _ismbcpunct_l(long ptr) +@ cdecl _ismbcspace(long) +@ cdecl _ismbcspace_l(long ptr) +@ cdecl _ismbcsymbol(long) +@ stub _ismbcsymbol_l +@ cdecl _ismbcupper(long) +@ cdecl _ismbcupper_l(long ptr) +@ cdecl _ismbslead(ptr ptr) +@ stub _ismbslead_l +@ cdecl _ismbstrail(ptr ptr) +@ stub _ismbstrail_l +@ cdecl _isnan(double) +@ cdecl -arch=x86_64 _isnanf(float) +@ cdecl _isprint_l(long ptr) +@ cdecl _ispunct_l(long ptr) +@ cdecl _isspace_l(long ptr) +@ cdecl _isupper_l(long ptr) +@ cdecl _iswalnum_l(long ptr) +@ cdecl _iswalpha_l(long ptr) +@ cdecl _iswblank_l(long ptr) +@ cdecl _iswcntrl_l(long ptr) +@ stub _iswcsym_l +@ stub _iswcsymf_l +@ cdecl _iswctype_l(long long ptr) +@ cdecl _iswdigit_l(long ptr) +@ cdecl _iswgraph_l(long ptr) +@ cdecl _iswlower_l(long ptr) +@ cdecl _iswprint_l(long ptr) +@ cdecl _iswpunct_l(long ptr) +@ cdecl _iswspace_l(long ptr) +@ cdecl _iswupper_l(long ptr) +@ cdecl _iswxdigit_l(long ptr) +@ cdecl _isxdigit_l(long ptr) +@ cdecl _itoa(long ptr long) +@ cdecl _itoa_s(long ptr long long) +@ cdecl _itow(long ptr long) ntdll._itow +@ cdecl _itow_s(long ptr long long) +@ cdecl _j0(double) +@ cdecl _j1(double) +@ cdecl _jn(long double) +@ cdecl _kbhit() +@ stub _ld_int +@ cdecl _ldclass(double) _dclass +@ stub _ldexp +@ stub _ldlog +@ cdecl _ldpcomp(double double) _dpcomp +@ stub _ldpoly +@ stub _ldscale +@ cdecl _ldsign(double) _dsign +@ stub _ldsin +@ cdecl _ldtest(ptr) _dtest +@ stub _ldunscale +@ cdecl _lfind(ptr ptr ptr long ptr) +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) +@ cdecl -arch=i386 -norelay _libm_sse2_acos_precise() __libm_sse2_acos +@ cdecl -arch=i386 -norelay _libm_sse2_asin_precise() __libm_sse2_asin +@ cdecl -arch=i386 -norelay _libm_sse2_atan_precise() __libm_sse2_atan +@ cdecl -arch=i386 -norelay _libm_sse2_cos_precise() __libm_sse2_cos +@ cdecl -arch=i386 -norelay _libm_sse2_exp_precise() __libm_sse2_exp +@ cdecl -arch=i386 -norelay _libm_sse2_log10_precise() __libm_sse2_log10 +@ cdecl -arch=i386 -norelay _libm_sse2_log_precise() __libm_sse2_log +@ cdecl -arch=i386 -norelay _libm_sse2_pow_precise() __libm_sse2_pow +@ cdecl -arch=i386 -norelay _libm_sse2_sin_precise() __libm_sse2_sin +@ cdecl -arch=i386 -norelay _libm_sse2_sqrt_precise() __libm_sse2_sqrt_precise +@ cdecl -arch=i386 -norelay _libm_sse2_tan_precise() __libm_sse2_tan +@ cdecl _loaddll(str) +@ cdecl -arch=x86_64,arm64 _local_unwind(ptr ptr) +@ cdecl -arch=i386 _local_unwind2(ptr long) +@ cdecl -arch=i386 _local_unwind4(ptr ptr long) +@ cdecl _localtime32(ptr) +@ cdecl _localtime32_s(ptr ptr) +@ cdecl _localtime64(ptr) +@ cdecl _localtime64_s(ptr ptr) +@ cdecl _lock_file(ptr) +@ cdecl _lock_locales() +@ cdecl _locking(long long long) +@ cdecl _logb(double) +@ cdecl -arch=!i386 _logbf(float) +@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp +@ cdecl _lrotl(long long) MSVCRT__lrotl +@ cdecl _lrotr(long long) MSVCRT__lrotr +@ cdecl _lsearch(ptr ptr ptr long ptr) +@ stub _lsearch_s +@ cdecl _lseek(long long long) +@ cdecl -ret64 _lseeki64(long int64 long) +@ cdecl _ltoa(long ptr long) ntdll._ltoa +@ cdecl _ltoa_s(long ptr long long) +@ cdecl _ltow(long ptr long) ntdll._ltow +@ cdecl _ltow_s(long ptr long long) +@ cdecl _makepath(ptr str str str str) +@ cdecl _makepath_s(ptr long str str str str) +@ cdecl _malloc_base(long) +@ cdecl _mbbtombc(long) +@ stub _mbbtombc_l +@ cdecl _mbbtype(long long) +@ cdecl _mbbtype_l(long long ptr) +@ stub _mbcasemap +@ cdecl _mbccpy(ptr ptr) +@ cdecl _mbccpy_l(ptr ptr ptr) +@ cdecl _mbccpy_s(ptr long ptr ptr) +@ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) +@ cdecl _mbcjistojms(long) +@ stub _mbcjistojms_l +@ cdecl _mbcjmstojis(long) +@ stub _mbcjmstojis_l +@ cdecl _mbclen(ptr) +@ stub _mbclen_l +@ cdecl _mbctohira(long) +@ stub _mbctohira_l +@ cdecl _mbctokata(long) +@ stub _mbctokata_l +@ cdecl _mbctolower(long) +@ stub _mbctolower_l +@ cdecl _mbctombb(long) +@ stub _mbctombb_l +@ cdecl _mbctoupper(long) +@ stub _mbctoupper_l +@ stub _mblen_l +@ cdecl _mbsbtype(str long) +@ stub _mbsbtype_l +@ cdecl _mbscat_s(ptr long str) +@ cdecl _mbscat_s_l(ptr long str ptr) +@ cdecl _mbschr(str long) +@ stub _mbschr_l +@ cdecl _mbscmp(str str) +@ cdecl _mbscmp_l(str str ptr) +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) +@ cdecl _mbscpy_s(ptr long str) +@ cdecl _mbscpy_s_l(ptr long str ptr) +@ cdecl _mbscspn(str str) +@ cdecl _mbscspn_l(str str ptr) +@ cdecl _mbsdec(ptr ptr) +@ stub _mbsdec_l +@ cdecl _mbsdup(str) _strdup +@ cdecl _mbsicmp(str str) +@ stub _mbsicmp_l +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) +@ stub _mbsinc_l +@ cdecl _mbslen(str) +@ cdecl _mbslen_l(str ptr) +@ cdecl _mbslwr(str) +@ stub _mbslwr_l +@ cdecl _mbslwr_s(str long) +@ stub _mbslwr_s_l +@ cdecl _mbsnbcat(str str long) +@ stub _mbsnbcat_l +@ cdecl _mbsnbcat_s(str long ptr long) +@ stub _mbsnbcat_s_l +@ cdecl _mbsnbcmp(str str long) +@ stub _mbsnbcmp_l +@ cdecl _mbsnbcnt(ptr long) +@ stub _mbsnbcnt_l +@ cdecl _mbsnbcoll(str str long) +@ cdecl _mbsnbcoll_l(str str long ptr) +@ cdecl _mbsnbcpy(ptr str long) +@ stub _mbsnbcpy_l +@ cdecl _mbsnbcpy_s(ptr long str long) +@ cdecl _mbsnbcpy_s_l(ptr long str long ptr) +@ cdecl _mbsnbicmp(str str long) +@ stub _mbsnbicmp_l +@ cdecl _mbsnbicoll(str str long) +@ cdecl _mbsnbicoll_l(str str long ptr) +@ cdecl _mbsnbset(ptr long long) +@ stub _mbsnbset_l +@ stub _mbsnbset_s +@ stub _mbsnbset_s_l +@ cdecl _mbsncat(str str long) +@ stub _mbsncat_l +@ stub _mbsncat_s +@ stub _mbsncat_s_l +@ cdecl _mbsnccnt(str long) +@ stub _mbsnccnt_l +@ cdecl _mbsncmp(str str long) +@ stub _mbsncmp_l +@ stub _mbsncoll(str str long) +@ stub _mbsncoll_l +@ cdecl _mbsncpy(ptr str long) +@ stub _mbsncpy_l +@ stub _mbsncpy_s +@ stub _mbsncpy_s_l +@ cdecl _mbsnextc(str) +@ cdecl _mbsnextc_l(str ptr) +@ cdecl _mbsnicmp(str str long) +@ stub _mbsnicmp_l +@ stub _mbsnicoll(str str long) +@ stub _mbsnicoll_l +@ cdecl _mbsninc(str long) +@ stub _mbsninc_l +@ cdecl _mbsnlen(str long) +@ cdecl _mbsnlen_l(str long ptr) +@ cdecl _mbsnset(ptr long long) +@ stub _mbsnset_l +@ stub _mbsnset_s +@ stub _mbsnset_s_l +@ cdecl _mbspbrk(str str) +@ stub _mbspbrk_l +@ cdecl _mbsrchr(str long) +@ stub _mbsrchr_l +@ cdecl _mbsrev(str) +@ stub _mbsrev_l +@ cdecl _mbsset(ptr long) +@ stub _mbsset_l +@ stub _mbsset_s +@ stub _mbsset_s_l +@ cdecl _mbsspn(str str) +@ cdecl _mbsspn_l(str str ptr) +@ cdecl _mbsspnp(str str) +@ stub _mbsspnp_l +@ cdecl _mbsstr(str str) +@ stub _mbsstr_l +@ cdecl _mbstok(str str) +@ cdecl _mbstok_l(str str ptr) +@ cdecl _mbstok_s(str str ptr) +@ cdecl _mbstok_s_l(str str ptr ptr) +@ cdecl _mbstowcs_l(ptr str long ptr) +@ cdecl _mbstowcs_s_l(ptr ptr long str long ptr) +@ cdecl _mbstrlen(str) +@ cdecl _mbstrlen_l(str ptr) +@ stub _mbstrnlen +@ stub _mbstrnlen_l +@ cdecl _mbsupr(str) +@ stub _mbsupr_l +@ cdecl _mbsupr_s(str long) +@ stub _mbsupr_s_l +@ cdecl _mbtowc_l(ptr str long ptr) +@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy +@ cdecl _memicmp(str str long) +@ cdecl _memicmp_l(str str long ptr) +@ cdecl _mkdir(str) +@ cdecl _mkgmtime32(ptr) +@ cdecl _mkgmtime64(ptr) +@ cdecl _mktemp(str) +@ cdecl _mktemp_s(str long) +@ cdecl _mktime32(ptr) +@ cdecl _mktime64(ptr) +@ cdecl _msize(ptr) +@ cdecl _nextafter(double double) +@ cdecl -arch=x86_64 _nextafterf(float float) +@ cdecl -arch=i386 _o__CIacos() _CIacos +@ cdecl -arch=i386 _o__CIasin() _CIasin +@ cdecl -arch=i386 _o__CIatan() _CIatan +@ cdecl -arch=i386 _o__CIatan2() _CIatan2 +@ cdecl -arch=i386 _o__CIcos() _CIcos +@ cdecl -arch=i386 _o__CIcosh() _CIcosh +@ cdecl -arch=i386 _o__CIexp() _CIexp +@ cdecl -arch=i386 _o__CIfmod() _CIfmod +@ cdecl -arch=i386 _o__CIlog() _CIlog +@ cdecl -arch=i386 _o__CIlog10() _CIlog10 +@ cdecl -arch=i386 _o__CIpow() _CIpow +@ cdecl -arch=i386 _o__CIsin() _CIsin +@ cdecl -arch=i386 _o__CIsinh() _CIsinh +@ cdecl -arch=i386 _o__CIsqrt() _CIsqrt +@ cdecl -arch=i386 _o__CItan() _CItan +@ cdecl -arch=i386 _o__CItanh() _CItanh +@ cdecl _o__Getdays() _Getdays +@ cdecl _o__Getmonths() _Getmonths +@ cdecl _o__Gettnames() _Gettnames +@ cdecl _o__Strftime(ptr long str ptr ptr) _Strftime +@ cdecl _o__W_Getdays() _W_Getdays +@ cdecl _o__W_Getmonths() _W_Getmonths +@ cdecl _o__W_Gettnames() _W_Gettnames +@ cdecl _o__Wcsftime(ptr long wstr ptr ptr) _Wcsftime +@ cdecl _o____lc_codepage_func() ___lc_codepage_func +@ cdecl _o____lc_collate_cp_func() ___lc_collate_cp_func +@ cdecl _o____lc_locale_name_func() ___lc_locale_name_func +@ cdecl _o____mb_cur_max_func() ___mb_cur_max_func +@ cdecl _o___acrt_iob_func(long) __acrt_iob_func +@ cdecl _o___conio_common_vcprintf(int64 str ptr ptr) __conio_common_vcprintf +@ stub _o___conio_common_vcprintf_p +@ stub _o___conio_common_vcprintf_s +@ stub _o___conio_common_vcscanf +@ cdecl _o___conio_common_vcwprintf(int64 wstr ptr ptr) __conio_common_vcwprintf +@ stub _o___conio_common_vcwprintf_p +@ stub _o___conio_common_vcwprintf_s +@ stub _o___conio_common_vcwscanf +@ cdecl _o___daylight() __p__daylight +@ cdecl _o___dstbias() __p__dstbias +@ cdecl _o___fpe_flt_rounds() __fpe_flt_rounds +@ cdecl -arch=i386 -norelay _o___libm_sse2_acos() __libm_sse2_acos +@ cdecl -arch=i386 -norelay _o___libm_sse2_acosf() __libm_sse2_acosf +@ cdecl -arch=i386 -norelay _o___libm_sse2_asin() __libm_sse2_asin +@ cdecl -arch=i386 -norelay _o___libm_sse2_asinf() __libm_sse2_asinf +@ cdecl -arch=i386 -norelay _o___libm_sse2_atan() __libm_sse2_atan +@ cdecl -arch=i386 -norelay _o___libm_sse2_atan2() __libm_sse2_atan2 +@ cdecl -arch=i386 -norelay _o___libm_sse2_atanf() __libm_sse2_atanf +@ cdecl -arch=i386 -norelay _o___libm_sse2_cos() __libm_sse2_cos +@ cdecl -arch=i386 -norelay _o___libm_sse2_cosf() __libm_sse2_cosf +@ cdecl -arch=i386 -norelay _o___libm_sse2_exp() __libm_sse2_exp +@ cdecl -arch=i386 -norelay _o___libm_sse2_expf() __libm_sse2_expf +@ cdecl -arch=i386 -norelay _o___libm_sse2_log() __libm_sse2_log +@ cdecl -arch=i386 -norelay _o___libm_sse2_log10() __libm_sse2_log10 +@ cdecl -arch=i386 -norelay _o___libm_sse2_log10f() __libm_sse2_log10f +@ cdecl -arch=i386 -norelay _o___libm_sse2_logf() __libm_sse2_logf +@ cdecl -arch=i386 -norelay _o___libm_sse2_pow() __libm_sse2_pow +@ cdecl -arch=i386 -norelay _o___libm_sse2_powf() __libm_sse2_powf +@ cdecl -arch=i386 -norelay _o___libm_sse2_sin() __libm_sse2_sin +@ cdecl -arch=i386 -norelay _o___libm_sse2_sinf() __libm_sse2_sinf +@ cdecl -arch=i386 -norelay _o___libm_sse2_tan() __libm_sse2_tan +@ cdecl -arch=i386 -norelay _o___libm_sse2_tanf() __libm_sse2_tanf +@ cdecl _o___p___argc() __p___argc +@ cdecl _o___p___argv() __p___argv +@ cdecl _o___p___wargv() __p___wargv +@ cdecl _o___p__acmdln() __p__acmdln +@ cdecl _o___p__commode() __p__commode +@ cdecl _o___p__environ() __p__environ +@ cdecl _o___p__fmode() __p__fmode +@ stub _o___p__mbcasemap +@ cdecl _o___p__mbctype() __p__mbctype +@ cdecl _o___p__pgmptr() __p__pgmptr +@ cdecl _o___p__wcmdln() __p__wcmdln +@ cdecl _o___p__wenviron() __p__wenviron +@ cdecl _o___p__wpgmptr() __p__wpgmptr +@ cdecl _o___pctype_func() __pctype_func +@ stub _o___pwctype_func +@ cdecl _o___std_exception_copy(ptr ptr) __std_exception_copy +@ cdecl _o___std_exception_destroy(ptr) __std_exception_destroy +@ cdecl _o___std_type_info_destroy_list(ptr) __std_type_info_destroy_list +@ cdecl _o___std_type_info_name(ptr ptr) __std_type_info_name +@ cdecl _o___stdio_common_vfprintf(int64 ptr str ptr ptr) _stdio_common_vfprintf +@ stub _o___stdio_common_vfprintf_p +@ cdecl _o___stdio_common_vfprintf_s(int64 ptr str ptr ptr) __stdio_common_vfprintf_s +@ cdecl _o___stdio_common_vfscanf(int64 ptr str ptr ptr) __stdio_common_vfscanf +@ cdecl _o___stdio_common_vfwprintf(int64 ptr wstr ptr ptr) __stdio_common_vfwprintf +@ stub _o___stdio_common_vfwprintf_p +@ cdecl _o___stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) __stdio_common_vfwprintf_s +@ cdecl _o___stdio_common_vfwscanf(int64 ptr wstr ptr ptr) __stdio_common_vfwscanf +@ cdecl _o___stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) __stdio_common_vsnprintf_s +@ cdecl _o___stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) __stdio_common_vsnwprintf_s +@ cdecl _o___stdio_common_vsprintf(int64 ptr long str ptr ptr) __stdio_common_vsprintf +@ cdecl _o___stdio_common_vsprintf_p(int64 ptr long str ptr ptr) __stdio_common_vsprintf_p +@ cdecl _o___stdio_common_vsprintf_s(int64 ptr long str ptr ptr) __stdio_common_vsprintf_s +@ cdecl _o___stdio_common_vsscanf(int64 ptr long str ptr ptr) __stdio_common_vsscanf +@ cdecl _o___stdio_common_vswprintf(int64 ptr long wstr ptr ptr) __stdio_common_vswprintf +@ cdecl _o___stdio_common_vswprintf_p(int64 ptr long wstr ptr ptr) __stdio_common_vswprintf_p +@ cdecl _o___stdio_common_vswprintf_s(int64 ptr long wstr ptr ptr) __stdio_common_vswprintf_s +@ cdecl _o___stdio_common_vswscanf(int64 ptr long wstr ptr ptr) __stdio_common_vswscanf +@ cdecl _o___timezone() __p__timezone +@ cdecl _o___tzname() __p__tzname +@ cdecl _o___wcserror(wstr) __wcserror +@ cdecl _o__access(str long) _access +@ cdecl _o__access_s(str long) _access_s +@ cdecl _o__aligned_free(ptr) _aligned_free +@ cdecl _o__aligned_malloc(long long) _aligned_malloc +@ cdecl _o__aligned_msize(ptr long long) _aligned_msize +@ cdecl _o__aligned_offset_malloc(long long long) _aligned_offset_malloc +@ cdecl _o__aligned_offset_realloc(ptr long long long) _aligned_offset_realloc +@ stub _o__aligned_offset_recalloc +@ cdecl _o__aligned_realloc(ptr long long) _aligned_realloc +@ stub _o__aligned_recalloc +@ cdecl _o__atodbl(ptr str) _atodbl +@ cdecl _o__atodbl_l(ptr str ptr) _atodbl_l +@ cdecl _o__atof_l(str ptr) _atof_l +@ cdecl _o__atoflt(ptr str) _atoflt +@ cdecl _o__atoflt_l(ptr str ptr) _atoflt_l +@ cdecl -ret64 _o__atoi64(str) _atoi64 +@ cdecl -ret64 _o__atoi64_l(str ptr) _atoi64_l +@ cdecl _o__atoi_l(str ptr) _atoi_l +@ cdecl _o__atol_l(str ptr) _atol_l +@ cdecl _o__atoldbl(ptr str) _atoldbl +@ cdecl _o__atoldbl_l(ptr str ptr) _atoldbl_l +@ cdecl -ret64 _o__atoll_l(str ptr) _atoll_l +@ cdecl _o__beep(long long) _beep +@ cdecl _o__beginthread(ptr long ptr) _beginthread +@ cdecl _o__beginthreadex(ptr long ptr ptr long ptr) _beginthreadex +@ cdecl _o__cabs(long) _cabs +@ cdecl _o__callnewh(long) _callnewh +@ cdecl _o__calloc_base(long long) _calloc_base +@ cdecl _o__cexit() _cexit +@ cdecl _o__cgets(ptr) _cgets +@ stub _o__cgets_s +@ stub _o__cgetws +@ stub _o__cgetws_s +@ cdecl _o__chdir(str) _chdir +@ cdecl _o__chdrive(long) _chdrive +@ cdecl _o__chmod(str long) _chmod +@ cdecl _o__chsize(long long) _chsize +@ cdecl _o__chsize_s(long int64) _chsize_s +@ cdecl _o__close(long) _close +@ cdecl _o__commit(long) _commit +@ cdecl _o__configthreadlocale(long) _configthreadlocale +@ cdecl _o__configure_narrow_argv(long) _configure_narrow_argv +@ cdecl _o__configure_wide_argv(long) _configure_wide_argv +@ cdecl _o__controlfp_s(ptr long long) _controlfp_s +@ cdecl _o__cputs(str) _cputs +@ cdecl _o__cputws(wstr) _cputws +@ cdecl _o__creat(str long) _creat +@ cdecl _o__create_locale(long str) _create_locale +@ cdecl _o__crt_atexit(ptr) _crt_atexit +@ cdecl _o__ctime32_s(str long ptr) _ctime32_s +@ cdecl _o__ctime64_s(str long ptr) _ctime64_s +@ cdecl _o__cwait(ptr long long) _cwait +@ stub _o__d_int +@ cdecl _o__dclass(double) _dclass +@ cdecl _o__difftime32(long long) _difftime32 +@ cdecl _o__difftime64(int64 int64) _difftime64 +@ stub _o__dlog +@ stub _o__dnorm +@ cdecl _o__dpcomp(double double) _dpcomp +@ stub _o__dpoly +@ stub _o__dscale +@ cdecl _o__dsign(double) _dsign +@ stub _o__dsin +@ cdecl _o__dtest(ptr) _dtest +@ stub _o__dunscale +@ cdecl _o__dup(long) _dup +@ cdecl _o__dup2(long long) _dup2 +@ cdecl _o__dupenv_s(ptr ptr str) _dupenv_s +@ cdecl _o__ecvt(double long ptr ptr) _ecvt +@ cdecl _o__ecvt_s(str long double long ptr ptr) _ecvt_s +@ cdecl _o__endthread() _endthread +@ cdecl _o__endthreadex(long) _endthreadex +@ cdecl _o__eof(long) _eof +@ cdecl _o__errno() _errno +@ cdecl _o__except1(long long double double long ptr) _except1 +@ cdecl _o__execute_onexit_table(ptr) _execute_onexit_table +@ cdecl _o__execv(str ptr) _execv +@ cdecl _o__execve(str ptr ptr) _execve +@ cdecl _o__execvp(str ptr) _execvp +@ cdecl _o__execvpe(str ptr ptr) _execvpe +@ cdecl _o__exit(long) _exit +@ cdecl _o__expand(ptr long) _expand +@ cdecl _o__fclose_nolock(ptr) _fclose_nolock +@ cdecl _o__fcloseall() _fcloseall +@ cdecl _o__fcvt(double long ptr ptr) _fcvt +@ cdecl _o__fcvt_s(ptr long double long ptr ptr) _fcvt_s +@ stub _o__fd_int +@ cdecl _o__fdclass(float) _fdclass +@ stub _o__fdexp +@ stub _o__fdlog +@ cdecl _o__fdopen(long str) _fdopen +@ cdecl _o__fdpcomp(float float) _fdpcomp +@ stub _o__fdpoly +@ stub _o__fdscale +@ cdecl _o__fdsign(float) _fdsign +@ stub _o__fdsin +@ cdecl _o__fflush_nolock(ptr) _fflush_nolock +@ cdecl _o__fgetc_nolock(ptr) _fgetc_nolock +@ cdecl _o__fgetchar() _fgetchar +@ cdecl _o__fgetwc_nolock(ptr) _fgetwc_nolock +@ cdecl _o__fgetwchar() _fgetwchar +@ cdecl _o__filelength(long) _filelength +@ cdecl -ret64 _o__filelengthi64(long) _filelengthi64 +@ cdecl _o__fileno(ptr) _fileno +@ cdecl _o__findclose(long) _findclose +@ cdecl _o__findfirst32(str ptr) _findfirst32 +@ stub _o__findfirst32i64 +@ cdecl _o__findfirst64(str ptr) _findfirst64 +@ cdecl _o__findfirst64i32(str ptr) _findfirst64i32 +@ cdecl _o__findnext32(long ptr) _findnext32 +@ stub _o__findnext32i64 +@ cdecl _o__findnext64(long ptr) _findnext64 +@ cdecl _o__findnext64i32(long ptr) _findnext64i32 +@ cdecl _o__flushall() _flushall +@ cdecl _o__fpclass(double) _fpclass +@ cdecl -arch=!i386 _o__fpclassf(float) _fpclassf +@ cdecl _o__fputc_nolock(long ptr) _fputc_nolock +@ cdecl _o__fputchar(long) _fputchar +@ cdecl _o__fputwc_nolock(long ptr) _fputwc_nolock +@ cdecl _o__fputwchar(long) _fputwchar +@ cdecl _o__fread_nolock(ptr long long ptr) _fread_nolock +@ cdecl _o__fread_nolock_s(ptr long long long ptr) _fread_nolock_s +@ cdecl _o__free_base(ptr) _free_base +@ cdecl _o__free_locale(ptr) _free_locale +@ cdecl _o__fseek_nolock(ptr long long) _fseek_nolock +@ cdecl _o__fseeki64(ptr int64 long) _fseeki64 +@ cdecl _o__fseeki64_nolock(ptr int64 long) _fseeki64_nolock +@ cdecl _o__fsopen(str str long) _fsopen +@ cdecl _o__fstat32(long ptr) _fstat32 +@ cdecl _o__fstat32i64(long ptr) _fstat32i64 +@ cdecl _o__fstat64(long ptr) _fstat64 +@ cdecl _o__fstat64i32(long ptr) _fstat64i32 +@ cdecl _o__ftell_nolock(ptr) _ftell_nolock +@ cdecl -ret64 _o__ftelli64(ptr) _ftelli64 +@ cdecl -ret64 _o__ftelli64_nolock(ptr) _ftelli64_nolock +@ cdecl _o__ftime32(ptr) _ftime32 +@ cdecl _o__ftime32_s(ptr) _ftime32_s +@ cdecl _o__ftime64(ptr) _ftime64 +@ cdecl _o__ftime64_s(ptr) _ftime64_s +@ cdecl _o__fullpath(ptr str long) _fullpath +@ cdecl _o__futime32(long ptr) _futime32 +@ cdecl _o__futime64(long ptr) _futime64 +@ cdecl _o__fwrite_nolock(ptr long long ptr) _fwrite_nolock +@ cdecl _o__gcvt(double long str) _gcvt +@ cdecl _o__gcvt_s(ptr long double long) _gcvt_s +@ cdecl _o__get_daylight(ptr) _get_daylight +@ cdecl _o__get_doserrno(ptr) _get_doserrno +@ cdecl _o__get_dstbias(ptr) _get_dstbias +@ cdecl _o__get_errno(ptr) _get_errno +@ cdecl _o__get_fmode(ptr) _get_fmode +@ cdecl _o__get_heap_handle() _get_heap_handle +@ cdecl _o__get_initial_narrow_environment() _get_initial_narrow_environment +@ cdecl _o__get_initial_wide_environment() _get_initial_wide_environment +@ cdecl _o__get_invalid_parameter_handler() _get_invalid_parameter_handler +@ cdecl _o__get_narrow_winmain_command_line() _get_narrow_winmain_command_line +@ cdecl _o__get_osfhandle(long) _get_osfhandle +@ cdecl _o__get_pgmptr(ptr) _get_pgmptr +@ cdecl _o__get_stream_buffer_pointers(ptr ptr ptr ptr) _get_stream_buffer_pointers +@ cdecl _o__get_terminate() _get_terminate +@ cdecl _o__get_thread_local_invalid_parameter_handler() _get_thread_local_invalid_parameter_handler +@ cdecl _o__get_timezone(ptr) _get_timezone +@ cdecl _o__get_tzname(ptr str long long) _get_tzname +@ cdecl _o__get_wide_winmain_command_line() _get_wide_winmain_command_line +@ cdecl _o__get_wpgmptr(ptr) _get_wpgmptr +@ cdecl _o__getc_nolock(ptr) _fgetc_nolock +@ cdecl _o__getch() _getch +@ cdecl _o__getch_nolock() _getch_nolock +@ cdecl _o__getche() _getche +@ cdecl _o__getche_nolock() _getche_nolock +@ cdecl _o__getcwd(str long) _getcwd +@ cdecl _o__getdcwd(long str long) _getdcwd +@ cdecl _o__getdiskfree(long ptr) _getdiskfree +@ cdecl _o__getdllprocaddr(long str long) _getdllprocaddr +@ cdecl _o__getdrive() _getdrive +@ cdecl _o__getdrives() kernel32.GetLogicalDrives +@ cdecl _o__getmbcp() _getmbcp +@ stub _o__getsystime +@ cdecl _o__getw(ptr) _getw +@ cdecl _o__getwc_nolock(ptr) _fgetwc_nolock +@ cdecl _o__getwch() _getwch +@ cdecl _o__getwch_nolock() _getwch_nolock +@ cdecl _o__getwche() _getwche +@ cdecl _o__getwche_nolock() _getwche_nolock +@ cdecl _o__getws(ptr) _getws +@ stub _o__getws_s +@ cdecl _o__gmtime32(ptr) _gmtime32 +@ cdecl _o__gmtime32_s(ptr ptr) _gmtime32_s +@ cdecl _o__gmtime64(ptr) _gmtime64 +@ cdecl _o__gmtime64_s(ptr ptr) _gmtime64_s +@ cdecl _o__heapchk() _heapchk +@ cdecl _o__heapmin() _heapmin +@ cdecl _o__hypot(double double) _hypot +@ cdecl _o__hypotf(float float) _hypotf +@ cdecl _o__i64toa(int64 ptr long) ntdll._i64toa +@ cdecl _o__i64toa_s(int64 ptr long long) _i64toa_s +@ cdecl _o__i64tow(int64 ptr long) ntdll._i64tow +@ cdecl _o__i64tow_s(int64 ptr long long) _i64tow_s +@ cdecl _o__initialize_narrow_environment() _initialize_narrow_environment +@ cdecl _o__initialize_onexit_table(ptr) _initialize_onexit_table +@ cdecl _o__initialize_wide_environment() _initialize_wide_environment +@ cdecl _o__invalid_parameter_noinfo() _invalid_parameter_noinfo +@ cdecl _o__invalid_parameter_noinfo_noreturn() _invalid_parameter_noinfo_noreturn +@ cdecl _o__isatty(long) _isatty +@ cdecl _o__isctype(long long) _isctype +@ cdecl _o__isctype_l(long long ptr) _isctype_l +@ cdecl _o__isleadbyte_l(long ptr) _isleadbyte_l +@ stub _o__ismbbalnum +@ stub _o__ismbbalnum_l +@ stub _o__ismbbalpha +@ stub _o__ismbbalpha_l +@ stub _o__ismbbblank +@ stub _o__ismbbblank_l +@ stub _o__ismbbgraph +@ stub _o__ismbbgraph_l +@ stub _o__ismbbkalnum +@ stub _o__ismbbkalnum_l +@ cdecl _o__ismbbkana(long) _ismbbkana +@ cdecl _o__ismbbkana_l(long ptr) _ismbbkana_l +@ stub _o__ismbbkprint +@ stub _o__ismbbkprint_l +@ stub _o__ismbbkpunct +@ stub _o__ismbbkpunct_l +@ cdecl _o__ismbblead(long) _ismbblead +@ cdecl _o__ismbblead_l(long ptr) _ismbblead_l +@ stub _o__ismbbprint +@ stub _o__ismbbprint_l +@ stub _o__ismbbpunct +@ stub _o__ismbbpunct_l +@ cdecl _o__ismbbtrail(long) _ismbbtrail +@ cdecl _o__ismbbtrail_l(long ptr) _ismbbtrail_l +@ cdecl _o__ismbcalnum(long) _ismbcalnum +@ cdecl _o__ismbcalnum_l(long ptr) _ismbcalnum_l +@ cdecl _o__ismbcalpha(long) _ismbcalpha +@ cdecl _o__ismbcalpha_l(long ptr) _ismbcalpha_l +@ stub _o__ismbcblank +@ stub _o__ismbcblank_l +@ cdecl _o__ismbcdigit(long) _ismbcdigit +@ cdecl _o__ismbcdigit_l(long ptr) _ismbcdigit_l +@ cdecl _o__ismbcgraph(long) _ismbcgraph +@ cdecl _o__ismbcgraph_l(long ptr) _ismbcgraph_l +@ cdecl _o__ismbchira(long) _ismbchira +@ stub _o__ismbchira_l +@ cdecl _o__ismbckata(long) _ismbckata +@ stub _o__ismbckata_l +@ cdecl _o__ismbcl0(long) _ismbcl0 +@ cdecl _o__ismbcl0_l(long ptr) _ismbcl0_l +@ cdecl _o__ismbcl1(long) _ismbcl1 +@ cdecl _o__ismbcl1_l(long ptr) _ismbcl1_l +@ cdecl _o__ismbcl2(long) _ismbcl2 +@ cdecl _o__ismbcl2_l(long ptr) _ismbcl2_l +@ cdecl _o__ismbclegal(long) _ismbclegal +@ cdecl _o__ismbclegal_l(long ptr) _ismbclegal_l +@ stub _o__ismbclower +@ cdecl _o__ismbclower_l(long ptr) _ismbclower_l +@ cdecl _o__ismbcprint(long) _ismbcprint +@ cdecl _o__ismbcprint_l(long ptr) _ismbcprint_l +@ cdecl _o__ismbcpunct(long) _ismbcpunct +@ cdecl _o__ismbcpunct_l(long ptr) _ismbcpunct_l +@ cdecl _o__ismbcspace(long) _ismbcspace +@ cdecl _o__ismbcspace_l(long ptr) _ismbcspace_l +@ cdecl _o__ismbcsymbol(long) _ismbcsymbol +@ stub _o__ismbcsymbol_l +@ cdecl _o__ismbcupper(long) _ismbcupper +@ cdecl _o__ismbcupper_l(long ptr) _ismbcupper_l +@ cdecl _o__ismbslead(ptr ptr) _ismbslead +@ stub _o__ismbslead_l +@ cdecl _o__ismbstrail(ptr ptr) _ismbstrail +@ stub _o__ismbstrail_l +@ cdecl _o__iswctype_l(long long ptr) _iswctype_l +@ cdecl _o__itoa(long ptr long) _itoa +@ cdecl _o__itoa_s(long ptr long long) _itoa_s +@ cdecl _o__itow(long ptr long) ntdll._itow +@ cdecl _o__itow_s(long ptr long long) _itow_s +@ cdecl _o__j0(double) _j0 +@ cdecl _o__j1(double) _j1 +@ cdecl _o__jn(long double) _jn +@ cdecl _o__kbhit() _kbhit +@ stub _o__ld_int +@ cdecl _o__ldclass(double) _dclass +@ stub _o__ldexp +@ stub _o__ldlog +@ cdecl _o__ldpcomp(double double) _dpcomp +@ stub _o__ldpoly +@ stub _o__ldscale +@ cdecl _o__ldsign(double) _dsign +@ stub _o__ldsin +@ cdecl _o__ldtest(ptr) _dtest +@ stub _o__ldunscale +@ cdecl _o__lfind(ptr ptr ptr long ptr) _lfind +@ cdecl _o__lfind_s(ptr ptr ptr long ptr ptr) _lfind_s +@ cdecl -arch=i386 -norelay _o__libm_sse2_acos_precise() __libm_sse2_acos +@ cdecl -arch=i386 -norelay _o__libm_sse2_asin_precise() __libm_sse2_asin +@ cdecl -arch=i386 -norelay _o__libm_sse2_atan_precise() __libm_sse2_atan +@ cdecl -arch=i386 -norelay _o__libm_sse2_cos_precise() __libm_sse2_cos +@ cdecl -arch=i386 -norelay _o__libm_sse2_exp_precise() __libm_sse2_exp +@ cdecl -arch=i386 -norelay _o__libm_sse2_log10_precise() __libm_sse2_log10 +@ cdecl -arch=i386 -norelay _o__libm_sse2_log_precise() __libm_sse2_log +@ cdecl -arch=i386 -norelay _o__libm_sse2_pow_precise() __libm_sse2_pow +@ cdecl -arch=i386 -norelay _o__libm_sse2_sin_precise() __libm_sse2_sin +@ cdecl -arch=i386 -norelay _o__libm_sse2_sqrt_precise() __libm_sse2_sqrt_precise +@ cdecl -arch=i386 -norelay _o__libm_sse2_tan_precise() __libm_sse2_tan +@ cdecl _o__loaddll(str) _loaddll +@ cdecl _o__localtime32(ptr) _localtime32 +@ cdecl _o__localtime32_s(ptr ptr) _localtime32_s +@ cdecl _o__localtime64(ptr) _localtime64 +@ cdecl _o__localtime64_s(ptr ptr) _localtime64_s +@ cdecl _o__lock_file(ptr) _lock_file +@ cdecl _o__locking(long long long) _locking +@ cdecl _o__logb(double) _logb +@ cdecl -arch=!i386 _o__logbf(float) _logbf +@ cdecl _o__lsearch(ptr ptr ptr long ptr) _lsearch +@ stub _o__lsearch_s +@ cdecl _o__lseek(long long long) _lseek +@ cdecl -ret64 _o__lseeki64(long int64 long) _lseeki64 +@ cdecl _o__ltoa(long ptr long) ntdll._ltoa +@ cdecl _o__ltoa_s(long ptr long long) _ltoa_s +@ cdecl _o__ltow(long ptr long) ntdll._ltow +@ cdecl _o__ltow_s(long ptr long long) _ltow_s +@ cdecl _o__makepath(ptr str str str str) _makepath +@ cdecl _o__makepath_s(ptr long str str str str) _makepath_s +@ cdecl _o__malloc_base(long) _malloc_base +@ cdecl _o__mbbtombc(long) _mbbtombc +@ stub _o__mbbtombc_l +@ cdecl _o__mbbtype(long long) _mbbtype +@ cdecl _o__mbbtype_l(long long ptr) _mbbtype_l +@ cdecl _o__mbccpy(ptr ptr) _mbccpy +@ cdecl _o__mbccpy_l(ptr ptr ptr) _mbccpy_l +@ cdecl _o__mbccpy_s(ptr long ptr ptr) _mbccpy_s +@ cdecl _o__mbccpy_s_l(ptr long ptr ptr ptr) _mbccpy_s_l +@ cdecl _o__mbcjistojms(long) _mbcjistojms +@ stub _o__mbcjistojms_l +@ cdecl _o__mbcjmstojis(long) _mbcjmstojis +@ stub _o__mbcjmstojis_l +@ cdecl _o__mbclen(ptr) _mbclen +@ stub _o__mbclen_l +@ cdecl _o__mbctohira(long) _mbctohira +@ stub _o__mbctohira_l +@ cdecl _o__mbctokata(long) _mbctokata +@ stub _o__mbctokata_l +@ cdecl _o__mbctolower(long) _mbctolower +@ stub _o__mbctolower_l +@ cdecl _o__mbctombb(long) _mbctombb +@ stub _o__mbctombb_l +@ cdecl _o__mbctoupper(long) _mbctoupper +@ stub _o__mbctoupper_l +@ stub _o__mblen_l +@ cdecl _o__mbsbtype(str long) _mbsbtype +@ stub _o__mbsbtype_l +@ cdecl _o__mbscat_s(ptr long str) _mbscat_s +@ cdecl _o__mbscat_s_l(ptr long str ptr) _mbscat_s_l +@ cdecl _o__mbschr(str long) _mbschr +@ stub _o__mbschr_l +@ cdecl _o__mbscmp(str str) _mbscmp +@ cdecl _o__mbscmp_l(str str ptr) _mbscmp_l +@ cdecl _o__mbscoll(str str) _mbscoll +@ cdecl _o__mbscoll_l(str str ptr) _mbscoll_l +@ cdecl _o__mbscpy_s(ptr long str) _mbscpy_s +@ cdecl _o__mbscpy_s_l(ptr long str ptr) _mbscpy_s_l +@ cdecl _o__mbscspn(str str) _mbscspn +@ cdecl _o__mbscspn_l(str str ptr) _mbscspn_l +@ cdecl _o__mbsdec(ptr ptr) _mbsdec +@ stub _o__mbsdec_l +@ cdecl _o__mbsicmp(str str) _mbsicmp +@ stub _o__mbsicmp_l +@ cdecl _o__mbsicoll(str str) _mbsicoll +@ cdecl _o__mbsicoll_l(str str ptr) _mbsicoll_l +@ cdecl _o__mbsinc(str) _mbsinc +@ stub _o__mbsinc_l +@ cdecl _o__mbslen(str) _mbslen +@ cdecl _o__mbslen_l(str ptr) _mbslen_l +@ cdecl _o__mbslwr(str) _mbslwr +@ stub _o__mbslwr_l +@ cdecl _o__mbslwr_s(str long) _mbslwr_s +@ stub _o__mbslwr_s_l +@ cdecl _o__mbsnbcat(str str long) _mbsnbcat +@ stub _o__mbsnbcat_l +@ cdecl _o__mbsnbcat_s(str long ptr long) _mbsnbcat_s +@ stub _o__mbsnbcat_s_l +@ cdecl _o__mbsnbcmp(str str long) _mbsnbcmp +@ stub _o__mbsnbcmp_l +@ cdecl _o__mbsnbcnt(ptr long) _mbsnbcnt +@ stub _o__mbsnbcnt_l +@ cdecl _o__mbsnbcoll(str str long) _mbsnbcoll +@ cdecl _o__mbsnbcoll_l(str str long ptr) _mbsnbcoll_l +@ cdecl _o__mbsnbcpy(ptr str long) _mbsnbcpy +@ stub _o__mbsnbcpy_l +@ cdecl _o__mbsnbcpy_s(ptr long str long) _mbsnbcpy_s +@ cdecl _o__mbsnbcpy_s_l(ptr long str long ptr) _mbsnbcpy_s_l +@ cdecl _o__mbsnbicmp(str str long) _mbsnbicmp +@ stub _o__mbsnbicmp_l +@ cdecl _o__mbsnbicoll(str str long) _mbsnbicoll +@ cdecl _o__mbsnbicoll_l(str str long ptr) _mbsnbicoll_l +@ cdecl _o__mbsnbset(ptr long long) _mbsnbset +@ stub _o__mbsnbset_l +@ stub _o__mbsnbset_s +@ stub _o__mbsnbset_s_l +@ cdecl _o__mbsncat(str str long) _mbsncat +@ stub _o__mbsncat_l +@ stub _o__mbsncat_s +@ stub _o__mbsncat_s_l +@ cdecl _o__mbsnccnt(str long) _mbsnccnt +@ stub _o__mbsnccnt_l +@ cdecl _o__mbsncmp(str str long) _mbsncmp +@ stub _o__mbsncmp_l +@ stub _o__mbsncoll +@ stub _o__mbsncoll_l +@ cdecl _o__mbsncpy(ptr str long) _mbsncpy +@ stub _o__mbsncpy_l +@ stub _o__mbsncpy_s +@ stub _o__mbsncpy_s_l +@ cdecl _o__mbsnextc(str) _mbsnextc +@ cdecl _o__mbsnextc_l(str ptr) _mbsnextc_l +@ cdecl _o__mbsnicmp(str str long) _mbsnicmp +@ stub _o__mbsnicmp_l +@ stub _o__mbsnicoll +@ stub _o__mbsnicoll_l +@ cdecl _o__mbsninc(str long) _mbsninc +@ stub _o__mbsninc_l +@ cdecl _o__mbsnlen(str long) _mbsnlen +@ cdecl _o__mbsnlen_l(str long ptr) _mbsnlen_l +@ cdecl _o__mbsnset(ptr long long) _mbsnset +@ stub _o__mbsnset_l +@ stub _o__mbsnset_s +@ stub _o__mbsnset_s_l +@ cdecl _o__mbspbrk(str str) _mbspbrk +@ stub _o__mbspbrk_l +@ cdecl _o__mbsrchr(str long) _mbsrchr +@ stub _o__mbsrchr_l +@ cdecl _o__mbsrev(str) _mbsrev +@ stub _o__mbsrev_l +@ cdecl _o__mbsset(ptr long) _mbsset +@ stub _o__mbsset_l +@ stub _o__mbsset_s +@ stub _o__mbsset_s_l +@ cdecl _o__mbsspn(str str) _mbsspn +@ cdecl _o__mbsspn_l(str str ptr) _mbsspn_l +@ cdecl _o__mbsspnp(str str) _mbsspnp +@ stub _o__mbsspnp_l +@ cdecl _o__mbsstr(str str) _mbsstr +@ stub _o__mbsstr_l +@ cdecl _o__mbstok(str str) _mbstok +@ cdecl _o__mbstok_l(str str ptr) _mbstok_l +@ cdecl _o__mbstok_s(str str ptr) _mbstok_s +@ cdecl _o__mbstok_s_l(str str ptr ptr) _mbstok_s_l +@ cdecl _o__mbstowcs_l(ptr str long ptr) _mbstowcs_l +@ cdecl _o__mbstowcs_s_l(ptr ptr long str long ptr) _mbstowcs_s_l +@ cdecl _o__mbstrlen(str) _mbstrlen +@ cdecl _o__mbstrlen_l(str ptr) _mbstrlen_l +@ stub _o__mbstrnlen +@ stub _o__mbstrnlen_l +@ cdecl _o__mbsupr(str) _mbsupr +@ stub _o__mbsupr_l +@ cdecl _o__mbsupr_s(str long) _mbsupr_s +@ stub _o__mbsupr_s_l +@ cdecl _o__mbtowc_l(ptr str long ptr) _mbtowc_l +@ cdecl _o__memicmp(str str long) _memicmp +@ cdecl _o__memicmp_l(str str long ptr) _memicmp_l +@ cdecl _o__mkdir(str) _mkdir +@ cdecl _o__mkgmtime32(ptr) _mkgmtime32 +@ cdecl _o__mkgmtime64(ptr) _mkgmtime64 +@ cdecl _o__mktemp(str) _mktemp +@ cdecl _o__mktemp_s(str long) _mktemp_s +@ cdecl _o__mktime32(ptr) _mktime32 +@ cdecl _o__mktime64(ptr) _mktime64 +@ cdecl _o__msize(ptr) _msize +@ cdecl _o__nextafter(double double) _nextafter +@ cdecl -arch=x86_64 _o__nextafterf(float float) _nextafterf +@ cdecl _o__open_osfhandle(long long) _open_osfhandle +@ cdecl _o__pclose(ptr) _pclose +@ cdecl _o__pipe(ptr long long) _pipe +@ cdecl _o__popen(str str) _popen +@ cdecl _o__purecall() _purecall +@ cdecl _o__putc_nolock(long ptr) _fputc_nolock +@ cdecl _o__putch(long) _putch +@ cdecl _o__putch_nolock(long) _putch_nolock +@ cdecl _o__putenv(str) _putenv +@ cdecl _o__putenv_s(str str) _putenv_s +@ cdecl _o__putw(long ptr) _putw +@ cdecl _o__putwc_nolock(long ptr) _fputwc_nolock +@ cdecl _o__putwch(long) _putwch +@ cdecl _o__putwch_nolock(long) _putwch_nolock +@ cdecl _o__putws(wstr) _putws +@ cdecl _o__read(long ptr long) _read +@ cdecl _o__realloc_base(ptr long) _realloc_base +@ cdecl _o__recalloc(ptr long long) _recalloc +@ cdecl _o__register_onexit_function(ptr ptr) _register_onexit_function +@ cdecl _o__resetstkoflw() _resetstkoflw +@ cdecl _o__rmdir(str) _rmdir +@ cdecl _o__rmtmp() _rmtmp +@ cdecl _o__scalb(double long) _scalb +@ cdecl -arch=x86_64 _o__scalbf(float long) _scalbf +@ cdecl _o__searchenv(str str ptr) _searchenv +@ cdecl _o__searchenv_s(str str ptr long) _searchenv_s +@ cdecl _o__seh_filter_dll(long ptr) __CppXcptFilter +@ cdecl _o__seh_filter_exe(long ptr) _XcptFilter +@ cdecl _o__set_abort_behavior(long long) _set_abort_behavior +@ cdecl _o__set_app_type(long) __set_app_type +@ cdecl _o__set_doserrno(long) _set_doserrno +@ cdecl _o__set_errno(long) _set_errno +@ cdecl _o__set_fmode(long) _set_fmode +@ cdecl _o__set_invalid_parameter_handler(ptr) _set_invalid_parameter_handler +@ cdecl _o__set_new_handler(ptr) set_new_handler +@ cdecl _o__set_new_mode(long) _set_new_mode +@ cdecl _o__set_thread_local_invalid_parameter_handler(ptr) _set_thread_local_invalid_parameter_handler +@ cdecl _o__seterrormode(long) _seterrormode +@ cdecl _o__setmbcp(long) _setmbcp +@ cdecl _o__setmode(long long) _setmode +@ stub _o__setsystime +@ cdecl _o__sleep(long) _sleep +@ varargs _o__sopen(str long long) _sopen +@ cdecl _o__sopen_dispatch(str long long long ptr long) _sopen_dispatch +@ cdecl _o__sopen_s(ptr str long long long) _sopen_s +@ cdecl _o__spawnv(long str ptr) _spawnv +@ cdecl _o__spawnve(long str ptr ptr) _spawnve +@ cdecl _o__spawnvp(long str ptr) _spawnvp +@ cdecl _o__spawnvpe(long str ptr ptr) _spawnvpe +@ cdecl _o__splitpath(str ptr ptr ptr ptr) _splitpath +@ cdecl _o__splitpath_s(str ptr long ptr long ptr long ptr long) _splitpath_s +@ cdecl _o__stat32(str ptr) _stat32 +@ cdecl _o__stat32i64(str ptr) _stat32i64 +@ cdecl _o__stat64(str ptr) _stat64 +@ cdecl _o__stat64i32(str ptr) _stat64i32 +@ cdecl _o__strcoll_l(str str ptr) _strcoll_l +@ cdecl _o__strdate(ptr) _strdate +@ cdecl _o__strdate_s(ptr long) _strdate_s +@ cdecl _o__strdup(str) _strdup +@ cdecl _o__strerror(long) _strerror +@ stub _o__strerror_s +@ cdecl _o__strftime_l(ptr long str ptr ptr) _strftime_l +@ cdecl _o__stricmp(str str) _stricmp +@ cdecl _o__stricmp_l(str str ptr) _stricmp_l +@ cdecl _o__stricoll(str str) _stricoll +@ cdecl _o__stricoll_l(str str ptr) _stricoll_l +@ cdecl _o__strlwr(str) _strlwr +@ cdecl _o__strlwr_l(str ptr) _strlwr_l +@ cdecl _o__strlwr_s(ptr long) _strlwr_s +@ cdecl _o__strlwr_s_l(ptr long ptr) _strlwr_s_l +@ cdecl _o__strncoll(str str long) _strncoll +@ cdecl _o__strncoll_l(str str long ptr) _strncoll_l +@ cdecl _o__strnicmp(str str long) _strnicmp +@ cdecl _o__strnicmp_l(str str long ptr) _strnicmp_l +@ cdecl _o__strnicoll(str str long) _strnicoll +@ cdecl _o__strnicoll_l(str str long ptr) _strnicoll_l +@ cdecl _o__strnset_s(str long long long) _strnset_s +@ stub _o__strset_s +@ cdecl _o__strtime(ptr) _strtime +@ cdecl _o__strtime_s(ptr long) _strtime_s +@ cdecl _o__strtod_l(str ptr ptr) _strtod_l +@ cdecl _o__strtof_l(str ptr ptr) _strtof_l +@ cdecl -ret64 _o__strtoi64(str ptr long) _strtoi64 +@ cdecl -ret64 _o__strtoi64_l(str ptr long ptr) _strtoi64_l +@ cdecl _o__strtol_l(str ptr long ptr) _strtol_l +@ cdecl _o__strtold_l(str ptr ptr) _strtod_l +@ cdecl -ret64 _o__strtoll_l(str ptr long ptr) _strtoi64_l +@ cdecl -ret64 _o__strtoui64(str ptr long) _strtoui64 +@ cdecl -ret64 _o__strtoui64_l(str ptr long ptr) _strtoui64_l +@ cdecl _o__strtoul_l(str ptr long ptr) _strtoul_l +@ cdecl -ret64 _o__strtoull_l(str ptr long ptr) _strtoui64_l +@ cdecl _o__strupr(str) _strupr +@ cdecl _o__strupr_l(str ptr) _strupr_l +@ cdecl _o__strupr_s(str long) _strupr_s +@ cdecl _o__strupr_s_l(str long ptr) _strupr_s_l +@ cdecl _o__strxfrm_l(ptr str long ptr) _strxfrm_l +@ cdecl _o__swab(str str long) _swab +@ cdecl _o__tell(long) _tell +@ cdecl -ret64 _o__telli64(long) _telli64 +@ cdecl _o__timespec32_get(ptr long) _timespec32_get +@ cdecl _o__timespec64_get(ptr long) _timespec64_get +@ cdecl _o__tolower(long) _tolower +@ cdecl _o__tolower_l(long ptr) _tolower_l +@ cdecl _o__toupper(long) _toupper +@ cdecl _o__toupper_l(long ptr) _toupper_l +@ cdecl _o__towlower_l(long ptr) _towlower_l +@ cdecl _o__towupper_l(long ptr) _towupper_l +@ cdecl _o__tzset() _tzset +@ cdecl _o__ui64toa(int64 ptr long) ntdll._ui64toa +@ cdecl _o__ui64toa_s(int64 ptr long long) _ui64toa_s +@ cdecl _o__ui64tow(int64 ptr long) ntdll._ui64tow +@ cdecl _o__ui64tow_s(int64 ptr long long) _ui64tow_s +@ cdecl _o__ultoa(long ptr long) ntdll._ultoa +@ cdecl _o__ultoa_s(long ptr long long) _ultoa_s +@ cdecl _o__ultow(long ptr long) ntdll._ultow +@ cdecl _o__ultow_s(long ptr long long) _ultow_s +@ cdecl _o__umask(long) _umask +@ stub _o__umask_s +@ cdecl _o__ungetc_nolock(long ptr) _ungetc_nolock +@ cdecl _o__ungetch(long) _ungetch +@ cdecl _o__ungetch_nolock(long) _ungetch_nolock +@ cdecl _o__ungetwc_nolock(long ptr) _ungetwc_nolock +@ cdecl _o__ungetwch(long) _ungetwch +@ cdecl _o__ungetwch_nolock(long) _ungetwch_nolock +@ cdecl _o__unlink(str) _unlink +@ cdecl _o__unloaddll(long) _unloaddll +@ cdecl _o__unlock_file(ptr) _unlock_file +@ cdecl _o__utime32(str ptr) _utime32 +@ cdecl _o__utime64(str ptr) _utime64 +@ cdecl _o__waccess(wstr long) _waccess +@ cdecl _o__waccess_s(wstr long) _waccess_s +@ cdecl _o__wasctime(ptr) _wasctime +@ cdecl _o__wasctime_s(ptr long ptr) _wasctime_s +@ cdecl _o__wchdir(wstr) _wchdir +@ cdecl _o__wchmod(wstr long) _wchmod +@ cdecl _o__wcreat(wstr long) _wcreat +@ cdecl _o__wcreate_locale(long wstr) _wcreate_locale +@ cdecl _o__wcscoll_l(wstr wstr ptr) _wcscoll_l +@ cdecl _o__wcsdup(wstr) _wcsdup +@ cdecl _o__wcserror(long) _wcserror +@ cdecl _o__wcserror_s(ptr long long) _wcserror_s +@ cdecl _o__wcsftime_l(ptr long wstr ptr ptr) _wcsftime_l +@ cdecl _o__wcsicmp(wstr wstr) _wcsicmp +@ cdecl _o__wcsicmp_l(wstr wstr ptr) _wcsicmp_l +@ cdecl _o__wcsicoll(wstr wstr) _wcsicoll +@ cdecl _o__wcsicoll_l(wstr wstr ptr) _wcsicoll_l +@ cdecl _o__wcslwr(wstr) _wcslwr +@ cdecl _o__wcslwr_l(wstr ptr) _wcslwr_l +@ cdecl _o__wcslwr_s(wstr long) _wcslwr_s +@ cdecl _o__wcslwr_s_l(wstr long ptr) _wcslwr_s_l +@ cdecl _o__wcsncoll(wstr wstr long) _wcsncoll +@ cdecl _o__wcsncoll_l(wstr wstr long ptr) _wcsncoll_l +@ cdecl _o__wcsnicmp(wstr wstr long) _wcsnicmp +@ cdecl _o__wcsnicmp_l(wstr wstr long ptr) _wcsnicmp_l +@ cdecl _o__wcsnicoll(wstr wstr long) _wcsnicoll +@ cdecl _o__wcsnicoll_l(wstr wstr long ptr) _wcsnicoll_l +@ cdecl _o__wcsnset(wstr long long) _wcsnset +@ cdecl _o__wcsnset_s(wstr long long long) _wcsnset_s +@ cdecl _o__wcsset(wstr long) _wcsset +@ cdecl _o__wcsset_s(wstr long long) _wcsset_s +@ cdecl _o__wcstod_l(wstr ptr ptr) _wcstod_l +@ cdecl _o__wcstof_l(wstr ptr ptr) _wcstof_l +@ cdecl -ret64 _o__wcstoi64(wstr ptr long) _wcstoi64 +@ cdecl -ret64 _o__wcstoi64_l(wstr ptr long ptr) _wcstoi64_l +@ cdecl _o__wcstol_l(wstr ptr long ptr) _wcstol_l +@ cdecl _o__wcstold_l(wstr ptr ptr) _wcstod_l +@ cdecl -ret64 _o__wcstoll_l(wstr ptr long ptr) _wcstoi64_l +@ cdecl _o__wcstombs_l(ptr ptr long ptr) _wcstombs_l +@ cdecl _o__wcstombs_s_l(ptr ptr long wstr long ptr) _wcstombs_s_l +@ cdecl -ret64 _o__wcstoui64(wstr ptr long) _wcstoui64 +@ cdecl -ret64 _o__wcstoui64_l(wstr ptr long ptr) _wcstoui64_l +@ cdecl _o__wcstoul_l(wstr ptr long ptr) _wcstoul_l +@ cdecl -ret64 _o__wcstoull_l(wstr ptr long ptr) _wcstoui64_l +@ cdecl _o__wcsupr(wstr) _wcsupr +@ cdecl _o__wcsupr_l(wstr ptr) _wcsupr_l +@ cdecl _o__wcsupr_s(wstr long) _wcsupr_s +@ cdecl _o__wcsupr_s_l(wstr long ptr) _wcsupr_s_l +@ cdecl _o__wcsxfrm_l(ptr wstr long ptr) _wcsxfrm_l +@ cdecl _o__wctime32(ptr) _wctime32 +@ cdecl _o__wctime32_s(ptr long ptr) _wctime32_s +@ cdecl _o__wctime64(ptr) _wctime64 +@ cdecl _o__wctime64_s(ptr long ptr) _wctime64_s +@ cdecl _o__wctomb_l(ptr long ptr) _wctomb_l +@ cdecl _o__wctomb_s_l(ptr ptr long long ptr) _wctomb_s_l +@ cdecl _o__wdupenv_s(ptr ptr wstr) _wdupenv_s +@ cdecl _o__wexecv(wstr ptr) _wexecv +@ cdecl _o__wexecve(wstr ptr ptr) _wexecve +@ cdecl _o__wexecvp(wstr ptr) _wexecvp +@ cdecl _o__wexecvpe(wstr ptr ptr) _wexecvpe +@ cdecl _o__wfdopen(long wstr) _wfdopen +@ cdecl _o__wfindfirst32(wstr ptr) _wfindfirst32 +@ stub _o__wfindfirst32i64 +@ cdecl _o__wfindfirst64(wstr ptr) _wfindfirst64 +@ cdecl _o__wfindfirst64i32(wstr ptr) _wfindfirst64i32 +@ cdecl _o__wfindnext32(long ptr) _wfindnext32 +@ stub _o__wfindnext32i64 +@ cdecl _o__wfindnext64(long ptr) _wfindnext64 +@ cdecl _o__wfindnext64i32(long ptr) _wfindnext64i32 +@ cdecl _o__wfopen(wstr wstr) _wfopen +@ cdecl _o__wfopen_s(ptr wstr wstr) _wfopen_s +@ cdecl _o__wfreopen(wstr wstr ptr) _wfreopen +@ cdecl _o__wfreopen_s(ptr wstr wstr ptr) _wfreopen_s +@ cdecl _o__wfsopen(wstr wstr long) _wfsopen +@ cdecl _o__wfullpath(ptr wstr long) _wfullpath +@ cdecl _o__wgetcwd(wstr long) _wgetcwd +@ cdecl _o__wgetdcwd(long wstr long) _wgetdcwd +@ cdecl _o__wgetenv(wstr) _wgetenv +@ cdecl _o__wgetenv_s(ptr ptr long wstr) _wgetenv_s +@ cdecl _o__wmakepath(ptr wstr wstr wstr wstr) _wmakepath +@ cdecl _o__wmakepath_s(ptr long wstr wstr wstr wstr) _wmakepath_s +@ cdecl _o__wmkdir(wstr) _wmkdir +@ cdecl _o__wmktemp(wstr) _wmktemp +@ cdecl _o__wmktemp_s(wstr long) _wmktemp_s +@ cdecl _o__wperror(wstr) _wperror +@ cdecl _o__wpopen(wstr wstr) _wpopen +@ cdecl _o__wputenv(wstr) _wputenv +@ cdecl _o__wputenv_s(wstr wstr) _wputenv_s +@ cdecl _o__wremove(wstr) _wremove +@ cdecl _o__wrename(wstr wstr) _wrename +@ cdecl _o__write(long ptr long) _write +@ cdecl _o__wrmdir(wstr) _wrmdir +@ cdecl _o__wsearchenv(wstr wstr ptr) _wsearchenv +@ cdecl _o__wsearchenv_s(wstr wstr ptr long) _wsearchenv_s +@ cdecl _o__wsetlocale(long wstr) _wsetlocale +@ cdecl _o__wsopen_dispatch(wstr long long long ptr long) _wsopen_dispatch +@ cdecl _o__wsopen_s(ptr wstr long long long) _wsopen_s +@ cdecl _o__wspawnv(long wstr ptr) _wspawnv +@ cdecl _o__wspawnve(long wstr ptr ptr) _wspawnve +@ cdecl _o__wspawnvp(long wstr ptr) _wspawnvp +@ cdecl _o__wspawnvpe(long wstr ptr ptr) _wspawnvpe +@ cdecl _o__wsplitpath(wstr ptr ptr ptr ptr) _wsplitpath +@ cdecl _o__wsplitpath_s(wstr ptr long ptr long ptr long ptr long) _wsplitpath_s +@ cdecl _o__wstat32(wstr ptr) _wstat32 +@ cdecl _o__wstat32i64(wstr ptr) _wstat32i64 +@ cdecl _o__wstat64(wstr ptr) _wstat64 +@ cdecl _o__wstat64i32(wstr ptr) _wstat64i32 +@ cdecl _o__wstrdate(ptr) _wstrdate +@ cdecl _o__wstrdate_s(ptr long) _wstrdate_s +@ cdecl _o__wstrtime(ptr) _wstrtime +@ cdecl _o__wstrtime_s(ptr long) _wstrtime_s +@ cdecl _o__wsystem(wstr) _wsystem +@ cdecl _o__wtmpnam_s(ptr long) _wtmpnam_s +@ cdecl _o__wtof(wstr) _wtof +@ cdecl _o__wtof_l(wstr ptr) _wtof_l +@ cdecl _o__wtoi(wstr) _wtoi +@ cdecl -ret64 _o__wtoi64(wstr) _wtoi64 +@ cdecl -ret64 _o__wtoi64_l(wstr ptr) _wtoi64_l +@ cdecl _o__wtoi_l(wstr ptr) _wtoi_l +@ cdecl _o__wtol(wstr) _wtol +@ cdecl _o__wtol_l(wstr ptr) _wtol_l +@ cdecl -ret64 _o__wtoll(wstr) _wtoll +@ cdecl -ret64 _o__wtoll_l(wstr ptr) _wtoll_l +@ cdecl _o__wunlink(wstr) _wunlink +@ cdecl _o__wutime32(wstr ptr) _wutime32 +@ cdecl _o__wutime64(wstr ptr) _wutime64 +@ cdecl _o__y0(double) _y0 +@ cdecl _o__y1(double) _y1 +@ cdecl _o__yn(long double) _yn +@ cdecl _o_abort() abort +@ cdecl _o_acos(double) acos +@ cdecl -arch=!i386 _o_acosf(float) acosf +@ cdecl _o_acosh(double) acosh +@ cdecl _o_acoshf(float) acoshf +@ cdecl _o_acoshl(double) acosh +@ cdecl _o_asctime(ptr) asctime +@ cdecl _o_asctime_s(ptr long ptr) asctime_s +@ cdecl _o_asin(double) asin +@ cdecl -arch=!i386 _o_asinf(float) asinf +@ cdecl _o_asinh(double) asinh +@ cdecl _o_asinhf(float) asinhf +@ cdecl _o_asinhl(double) asinh +@ cdecl _o_atan(double) atan +@ cdecl _o_atan2(double double) atan2 +@ cdecl -arch=!i386 _o_atan2f(float float) atan2f +@ cdecl -arch=!i386 _o_atanf(float) atanf +@ cdecl _o_atanh(double) atanh +@ cdecl _o_atanhf(float) atanhf +@ cdecl _o_atanhl(double) atanh +@ cdecl _o_atof(str) atof +@ cdecl _o_atoi(str) atoi +@ cdecl _o_atol(str) atol +@ cdecl -ret64 _o_atoll(str) atoll +@ cdecl _o_bsearch(ptr ptr long long ptr) bsearch +@ cdecl _o_bsearch_s(ptr ptr long long ptr ptr) bsearch_s +@ cdecl _o_btowc(long) btowc +@ cdecl _o_calloc(long long) calloc +@ cdecl _o_cbrt(double) cbrt +@ cdecl _o_cbrtf(float) cbrtf +@ cdecl _o_ceil(double) ceil +@ cdecl -arch=!i386 _o_ceilf(float) ceilf +@ cdecl _o_clearerr(ptr) clearerr +@ cdecl _o_clearerr_s(ptr) clearerr_s +@ cdecl _o_cos(double) cos +@ cdecl -arch=!i386 _o_cosf(float) cosf +@ cdecl _o_cosh(double) cosh +@ cdecl -arch=!i386 _o_coshf(float) coshf +@ cdecl _o_erf(double) erf +@ cdecl _o_erfc(double) erfc +@ cdecl _o_erfcf(float) erfcf +@ cdecl _o_erfcl(double) erfc +@ cdecl _o_erff(float) erff +@ cdecl _o_erfl(double) erf +@ cdecl _o_exit(long) exit +@ cdecl _o_exp(double) exp +@ cdecl _o_exp2(double) exp2 +@ cdecl _o_exp2f(float) exp2f +@ cdecl _o_exp2l(double) exp2 +@ cdecl -arch=!i386 _o_expf(float) expf +@ cdecl _o_fabs(double) fabs +@ cdecl _o_fclose(ptr) fclose +@ cdecl _o_feof(ptr) feof +@ cdecl _o_ferror(ptr) ferror +@ cdecl _o_fflush(ptr) fflush +@ cdecl _o_fgetc(ptr) fgetc +@ cdecl _o_fgetpos(ptr ptr) fgetpos +@ cdecl _o_fgets(ptr long ptr) fgets +@ cdecl _o_fgetwc(ptr) fgetwc +@ cdecl _o_fgetws(ptr long ptr) fgetws +@ cdecl _o_floor(double) floor +@ cdecl -arch=!i386 _o_floorf(float) floorf +@ cdecl _o_fma(double double double) fma +@ cdecl _o_fmaf(float float float) fmaf +@ cdecl _o_fmal(double double double) fma +@ cdecl _o_fmod(double double) fmod +@ cdecl -arch=!i386 _o_fmodf(float float) fmodf +@ cdecl _o_fopen(str str) fopen +@ cdecl _o_fopen_s(ptr str str) fopen_s +@ cdecl _o_fputc(long ptr) fputc +@ cdecl _o_fputs(str ptr) fputs +@ cdecl _o_fputwc(long ptr) fputwc +@ cdecl _o_fputws(wstr ptr) fputws +@ cdecl _o_fread(ptr long long ptr) fread +@ cdecl _o_fread_s(ptr long long long ptr) fread_s +@ cdecl _o_free(ptr) free +@ cdecl _o_freopen(str str ptr) freopen +@ cdecl _o_freopen_s(ptr str str ptr) freopen_s +@ cdecl _o_frexp(double ptr) frexp +@ cdecl _o_fseek(ptr long long) fseek +@ cdecl _o_fsetpos(ptr ptr) fsetpos +@ cdecl _o_ftell(ptr) ftell +@ cdecl _o_fwrite(ptr long long ptr) fwrite +@ cdecl _o_getc(ptr) getc +@ cdecl _o_getchar() getchar +@ cdecl _o_getenv(str) getenv +@ cdecl _o_getenv_s(ptr ptr long str) getenv_s +@ cdecl _o_gets(str) gets +@ cdecl _o_gets_s(ptr long) gets_s +@ cdecl _o_getwc(ptr) getwc +@ cdecl _o_getwchar() getwchar +@ cdecl _o_hypot(double double) _hypot +@ cdecl _o_is_wctype(long long) iswctype +@ cdecl _o_isalnum(long) isalnum +@ cdecl _o_isalpha(long) isalpha +@ cdecl _o_isblank(long) isblank +@ cdecl _o_iscntrl(long) iscntrl +@ cdecl _o_isdigit(long) isdigit +@ cdecl _o_isgraph(long) isgraph +@ cdecl _o_isleadbyte(long) isleadbyte +@ cdecl _o_islower(long) islower +@ cdecl _o_isprint(long) isprint +@ cdecl _o_ispunct(long) ispunct +@ cdecl _o_isspace(long) isspace +@ cdecl _o_isupper(long) isupper +@ cdecl _o_iswalnum(long) iswalnum +@ cdecl _o_iswalpha(long) iswalpha +@ cdecl _o_iswascii(long) iswascii +@ cdecl _o_iswblank(long) iswblank +@ cdecl _o_iswcntrl(long) iswcntrl +@ cdecl _o_iswctype(long long) iswctype +@ cdecl _o_iswdigit(long) iswdigit +@ cdecl _o_iswgraph(long) iswgraph +@ cdecl _o_iswlower(long) iswlower +@ cdecl _o_iswprint(long) iswprint +@ cdecl _o_iswpunct(long) iswpunct +@ cdecl _o_iswspace(long) iswspace +@ cdecl _o_iswupper(long) iswupper +@ cdecl _o_iswxdigit(long) iswxdigit +@ cdecl _o_isxdigit(long) isxdigit +@ cdecl _o_ldexp(double long) ldexp +@ cdecl _o_lgamma(double) lgamma +@ cdecl _o_lgammaf(float) lgammaf +@ cdecl _o_lgammal(double) lgamma +@ cdecl -ret64 _o_llrint(double) llrint +@ cdecl -ret64 _o_llrintf(float) llrintf +@ cdecl -ret64 _o_llrintl(double) llrint +@ cdecl -ret64 _o_llround(double) llround +@ cdecl -ret64 _o_llroundf(float) llroundf +@ cdecl -ret64 _o_llroundl(double) llround +@ cdecl _o_localeconv() localeconv +@ cdecl _o_log(double) log +@ cdecl _o_log10(double) log10 +@ cdecl -arch=!i386 _o_log10f(float) log10f +@ cdecl _o_log1p(double) log1p +@ cdecl _o_log1pf(float) log1pf +@ cdecl _o_log1pl(double) log1p +@ cdecl _o_log2(double) log2 +@ cdecl _o_log2f(float) log2f +@ cdecl _o_log2l(double) log2 +@ cdecl _o_logb(double) _logb +@ cdecl _o_logbf(float) _logbf +@ cdecl _o_logbl(double) _logb +@ cdecl -arch=!i386 _o_logf(float) logf +@ cdecl _o_lrint(double) lrint +@ cdecl _o_lrintf(float) lrintf +@ cdecl _o_lrintl(double) lrint +@ cdecl _o_lround(double) lround +@ cdecl _o_lroundf(float) lroundf +@ cdecl _o_lroundl(double) lround +@ cdecl _o_malloc(long) malloc +@ cdecl _o_mblen(ptr long) mblen +@ cdecl _o_mbrlen(ptr long ptr) mbrlen +@ stub _o_mbrtoc16 +@ stub _o_mbrtoc32 +@ cdecl _o_mbrtowc(ptr str long ptr) mbrtowc +@ cdecl _o_mbsrtowcs(ptr ptr long ptr) mbsrtowcs +@ cdecl _o_mbsrtowcs_s(ptr ptr long ptr long ptr) mbsrtowcs_s +@ cdecl _o_mbstowcs(ptr str long) mbstowcs +@ cdecl _o_mbstowcs_s(ptr ptr long str long) _mbstowcs_s +@ cdecl _o_mbtowc(ptr str long) mbtowc +@ cdecl _o_memcpy_s(ptr long ptr long) memcpy_s +@ cdecl _o_memset(ptr long long) memset +@ cdecl _o_modf(double ptr) modf +@ cdecl -arch=!i386 _o_modff(float ptr) modff +@ cdecl _o_nan(str) nan +@ cdecl _o_nanf(str) nanf +@ cdecl _o_nanl(str) nan +@ cdecl _o_nearbyint(double) nearbyint +@ cdecl _o_nearbyintf(float) nearbyintf +@ cdecl _o_nearbyintl(double) nearbyint +@ cdecl _o_nextafter(double double) _nextafter +@ cdecl _o_nextafterf(float float) _nextafterf +@ cdecl _o_nextafterl(double double) _nextafter +@ cdecl _o_nexttoward(double double) MSVCRT_nexttoward +@ cdecl _o_nexttowardf(float double) MSVCRT_nexttowardf +@ cdecl _o_nexttowardl(double double) MSVCRT_nexttoward +@ cdecl _o_pow(double double) pow +@ cdecl -arch=!i386 _o_powf(float float) powf +@ cdecl _o_putc(long ptr) putc +@ cdecl _o_putchar(long) putchar +@ cdecl _o_puts(str) puts +@ cdecl _o_putwc(long ptr) fputwc +@ cdecl _o_putwchar(long) _fputwchar +@ cdecl _o_qsort(ptr long long ptr) qsort +@ cdecl _o_qsort_s(ptr long long ptr ptr) qsort_s +@ cdecl _o_raise(long) raise +@ cdecl _o_rand() rand +@ cdecl _o_rand_s(ptr) rand_s +@ cdecl _o_realloc(ptr long) realloc +@ cdecl _o_remainder(double double) remainder +@ cdecl _o_remainderf(float float) remainderf +@ cdecl _o_remainderl(double double) remainder +@ cdecl _o_remove(str) remove +@ cdecl _o_remquo(double double ptr) remquo +@ cdecl _o_remquof(float float ptr) remquof +@ cdecl _o_remquol(double double ptr) remquo +@ cdecl _o_rename(str str) rename +@ cdecl _o_rewind(ptr) rewind +@ cdecl _o_rint(double) rint +@ cdecl _o_rintf(float) rintf +@ cdecl _o_rintl(double) rint +@ cdecl _o_round(double) round +@ cdecl _o_roundf(float) roundf +@ cdecl _o_roundl(double) round +@ cdecl _o_scalbln(double long) _scalb +@ cdecl _o_scalblnf(float long) _scalbf +@ cdecl _o_scalblnl(double long) _scalb +@ cdecl _o_scalbn(double long) _scalb +@ cdecl _o_scalbnf(float long) _scalbf +@ cdecl _o_scalbnl(double long) _scalb +@ cdecl _o_set_terminate(ptr) set_terminate +@ cdecl _o_setbuf(ptr ptr) setbuf +@ cdecl _o_setlocale(long str) setlocale +@ cdecl _o_setvbuf(ptr str long long) setvbuf +@ cdecl _o_sin(double) sin +@ cdecl -arch=!i386 _o_sinf(float) sinf +@ cdecl _o_sinh(double) sinh +@ cdecl -arch=!i386 _o_sinhf(float) sinhf +@ cdecl _o_sqrt(double) sqrt +@ cdecl -arch=!i386 _o_sqrtf(float) sqrtf +@ cdecl _o_srand(long) srand +@ cdecl _o_strcat_s(str long str) strcat_s +@ cdecl _o_strcoll(str str) strcoll +@ cdecl _o_strcpy_s(ptr long str) strcpy_s +@ cdecl _o_strerror(long) strerror +@ cdecl _o_strerror_s(ptr long long) strerror_s +@ cdecl _o_strftime(ptr long str ptr) strftime +@ cdecl _o_strncat_s(str long str long) strncat_s +@ cdecl _o_strncpy_s(ptr long str long) strncpy_s +@ cdecl _o_strtod(str ptr) strtod +@ cdecl _o_strtof(str ptr) strtof +@ cdecl _o_strtok(str str) strtok +@ cdecl _o_strtok_s(ptr str ptr) strtok_s +@ cdecl _o_strtol(str ptr long) strtol +@ cdecl _o_strtold(str ptr) strtod +@ cdecl -ret64 _o_strtoll(str ptr long) _strtoi64 +@ cdecl _o_strtoul(str ptr long) strtoul +@ cdecl -ret64 _o_strtoull(str ptr long) _strtoui64 +@ cdecl _o_system(str) system +@ cdecl _o_tan(double) tan +@ cdecl -arch=!i386 _o_tanf(float) tanf +@ cdecl _o_tanh(double) tanh +@ cdecl -arch=!i386 _o_tanhf(float) tanhf +@ cdecl _o_terminate() terminate +@ cdecl _o_tgamma(double) tgamma +@ cdecl _o_tgammaf(float) tgammaf +@ cdecl _o_tgammal(double) tgamma +@ cdecl _o_tmpfile_s(ptr) tmpfile_s +@ cdecl _o_tmpnam_s(ptr long) tmpnam_s +@ cdecl _o_tolower(long) tolower +@ cdecl _o_toupper(long) toupper +@ cdecl _o_towlower(long) towlower +@ cdecl _o_towupper(long) towupper +@ cdecl _o_ungetc(long ptr) ungetc +@ cdecl _o_ungetwc(long ptr) ungetwc +@ cdecl _o_wcrtomb(ptr long ptr) wcrtomb +@ cdecl _o_wcrtomb_s(ptr ptr long long ptr) wcrtomb_s +@ cdecl _o_wcscat_s(wstr long wstr) wcscat_s +@ cdecl _o_wcscoll(wstr wstr) wcscoll +@ cdecl _o_wcscpy(ptr wstr) wcscpy +@ cdecl _o_wcscpy_s(ptr long wstr) wcscpy_s +@ cdecl _o_wcsftime(ptr long wstr ptr) wcsftime +@ cdecl _o_wcsncat_s(wstr long wstr long) wcsncat_s +@ cdecl _o_wcsncpy_s(ptr long wstr long) wcsncpy_s +@ cdecl _o_wcsrtombs(ptr ptr long ptr) wcsrtombs +@ cdecl _o_wcsrtombs_s(ptr ptr long ptr long ptr) wcsrtombs_s +@ cdecl _o_wcstod(wstr ptr) wcstod +@ cdecl _o_wcstof(ptr ptr) wcstof +@ cdecl _o_wcstok(wstr wstr ptr) wcstok +@ cdecl _o_wcstok_s(ptr wstr ptr) wcstok_s +@ cdecl _o_wcstol(wstr ptr long) wcstol +@ cdecl _o_wcstold(wstr ptr ptr) wcstod +@ cdecl -ret64 _o_wcstoll(wstr ptr long) _wcstoi64 +@ cdecl _o_wcstombs(ptr ptr long) wcstombs +@ cdecl _o_wcstombs_s(ptr ptr long wstr long) wcstombs_s +@ cdecl _o_wcstoul(wstr ptr long) wcstoul +@ cdecl -ret64 _o_wcstoull(wstr ptr long) _wcstoui64 +@ cdecl _o_wctob(long) wctob +@ cdecl _o_wctomb(ptr long) wctomb +@ cdecl _o_wctomb_s(ptr ptr long long) wctomb_s +@ cdecl _o_wmemcpy_s(ptr long ptr long) wmemcpy_s +@ cdecl _o_wmemmove_s(ptr long ptr long) wmemmove_s +@ varargs _open(str long) +@ cdecl _open_osfhandle(long long) +@ cdecl _pclose(ptr) +@ cdecl _pipe(ptr long long) +@ cdecl _popen(str str) +@ cdecl _purecall() +@ cdecl _putc_nolock(long ptr) _fputc_nolock +@ cdecl _putch(long) +@ cdecl _putch_nolock(long) +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) +@ cdecl _putwc_nolock(long ptr) _fputwc_nolock +@ cdecl _putwch(long) +@ cdecl _putwch_nolock(long) +@ cdecl _putws(wstr) +@ stub _query_app_type +@ cdecl _query_new_handler() +@ cdecl _query_new_mode() +@ cdecl _read(long ptr long) +@ cdecl _realloc_base(ptr long) +@ cdecl _recalloc(ptr long long) +@ cdecl _register_onexit_function(ptr ptr) +@ cdecl _register_thread_local_exe_atexit_callback(ptr) +@ cdecl _resetstkoflw() +@ cdecl _rmdir(str) +@ cdecl _rmtmp() +@ cdecl _rotl(long long) MSVCRT__rotl +@ cdecl -ret64 _rotl64(int64 long) MSVCRT__rotl64 +@ cdecl _rotr(long long) MSVCRT__rotr +@ cdecl -ret64 _rotr64(int64 long) MSVCRT__rotr64 +@ cdecl _scalb(double long) +@ cdecl -arch=x86_64 _scalbf(float long) +@ cdecl _searchenv(str str ptr) +@ cdecl _searchenv_s(str str ptr long) +@ cdecl -arch=i386,x86_64,arm,arm64 _seh_filter_dll(long ptr) __CppXcptFilter +@ cdecl _seh_filter_exe(long ptr) _XcptFilter +@ cdecl -arch=win64 _set_FMA3_enable(long) +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl -arch=i386 _set_SSE2_enable(long) +@ cdecl _set_abort_behavior(long long) +@ cdecl _set_app_type(long) __set_app_type +@ cdecl _set_controlfp(long long) +@ cdecl _set_doserrno(long) +@ cdecl _set_errno(long) +@ cdecl _set_error_mode(long) +@ cdecl _set_fmode(long) +@ cdecl _set_invalid_parameter_handler(ptr) +@ cdecl _set_new_handler(ptr) set_new_handler +@ cdecl _set_new_mode(long) +@ cdecl _set_printf_count_output(long) +@ cdecl _set_purecall_handler(ptr) +@ cdecl _set_se_translator(ptr) +@ cdecl _set_thread_local_invalid_parameter_handler(ptr) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 +@ cdecl _setmaxstdio(long) +@ cdecl _setmbcp(long) +@ cdecl _setmode(long long) +@ stub _setsystime(ptr long) +@ cdecl _sleep(long) +@ varargs _sopen(str long long) +@ cdecl _sopen_dispatch(str long long long ptr long) +@ cdecl _sopen_s(ptr str long long long) +@ varargs _spawnl(long str str) +@ varargs _spawnle(long str str) +@ varargs _spawnlp(long str str) +@ varargs _spawnlpe(long str str) +@ cdecl _spawnv(long str ptr) +@ cdecl _spawnve(long str ptr ptr) +@ cdecl _spawnvp(long str ptr) +@ cdecl _spawnvpe(long str ptr ptr) +@ cdecl _splitpath(str ptr ptr ptr ptr) +@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) +@ cdecl _stat32(str ptr) +@ cdecl _stat32i64(str ptr) +@ cdecl _stat64(str ptr) +@ cdecl _stat64i32(str ptr) +@ cdecl _statusfp() +@ cdecl -arch=i386 _statusfp2(ptr ptr) +@ cdecl _strcoll_l(str str ptr) +@ cdecl _strdate(ptr) +@ cdecl _strdate_s(ptr long) +@ cdecl _strdup(str) +@ cdecl _strerror(long) +@ stub _strerror_s +@ cdecl _strftime_l(ptr long str ptr ptr) +@ cdecl _stricmp(str str) +@ cdecl _stricmp_l(str str ptr) +@ cdecl _stricoll(str str) +@ cdecl _stricoll_l(str str ptr) +@ cdecl _strlwr(str) +@ cdecl _strlwr_l(str ptr) +@ cdecl _strlwr_s(ptr long) +@ cdecl _strlwr_s_l(ptr long ptr) +@ cdecl _strncoll(str str long) +@ cdecl _strncoll_l(str str long ptr) +@ cdecl _strnicmp(str str long) +@ cdecl _strnicmp_l(str str long ptr) +@ cdecl _strnicoll(str str long) +@ cdecl _strnicoll_l(str str long ptr) +@ cdecl _strnset(str long long) +@ cdecl _strnset_s(str long long long) +@ cdecl _strrev(str) +@ cdecl _strset(str long) +@ stub _strset_s +@ cdecl _strtime(ptr) +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) +@ cdecl _strtof_l(str ptr ptr) +@ cdecl -ret64 _strtoi64(str ptr long) +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) +@ cdecl -ret64 _strtoimax_l(str ptr long ptr) _strtoi64_l +@ cdecl _strtol_l(str ptr long ptr) +@ cdecl _strtold_l(str ptr ptr) _strtod_l +@ cdecl -ret64 _strtoll_l(str ptr long ptr) _strtoi64_l +@ cdecl -ret64 _strtoui64(str ptr long) +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) +@ cdecl _strtoul_l(str ptr long ptr) +@ cdecl -ret64 _strtoull_l(str ptr long ptr) _strtoui64_l +@ cdecl -ret64 _strtoumax_l(str ptr long ptr) _strtoui64_l +@ cdecl _strupr(str) +@ cdecl _strupr_l(str ptr) +@ cdecl _strupr_s(str long) +@ cdecl _strupr_s_l(str long ptr) +@ cdecl _strxfrm_l(ptr str long ptr) +@ cdecl _swab(str str long) +@ cdecl _tell(long) +@ cdecl -ret64 _telli64(long) +@ cdecl _tempnam(str str) +@ cdecl _time32(ptr) +@ cdecl _time64(ptr) +@ cdecl _timespec32_get(ptr long) +@ cdecl _timespec64_get(ptr long) +@ cdecl _tolower(long) +@ cdecl _tolower_l(long ptr) +@ cdecl _toupper(long) +@ cdecl _toupper_l(long ptr) +@ cdecl _towlower_l(long ptr) +@ cdecl _towupper_l(long ptr) +@ cdecl _tzset() +@ cdecl _ui64toa(int64 ptr long) ntdll._ui64toa +@ cdecl _ui64toa_s(int64 ptr long long) +@ cdecl _ui64tow(int64 ptr long) ntdll._ui64tow +@ cdecl _ui64tow_s(int64 ptr long long) +@ cdecl _ultoa(long ptr long) ntdll._ultoa +@ cdecl _ultoa_s(long ptr long long) +@ cdecl _ultow(long ptr long) ntdll._ultow +@ cdecl _ultow_s(long ptr long long) +@ cdecl _umask(long) +@ stub _umask_s +@ cdecl _ungetc_nolock(long ptr) +@ cdecl _ungetch(long) +@ cdecl _ungetch_nolock(long) +@ cdecl _ungetwc_nolock(long ptr) +@ cdecl _ungetwch(long) +@ cdecl _ungetwch_nolock(long) +@ cdecl _unlink(str) +@ cdecl _unloaddll(long) +@ cdecl _unlock_file(ptr) +@ cdecl _unlock_locales() +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _waccess(wstr long) +@ cdecl _waccess_s(wstr long) +@ cdecl _wasctime(ptr) +@ cdecl _wasctime_s(ptr long ptr) +@ cdecl _wassert(wstr wstr long) +@ cdecl _wchdir(wstr) +@ cdecl _wchmod(wstr long) +@ cdecl _wcreat(wstr long) +@ cdecl _wcreate_locale(long wstr) +@ cdecl _wcscoll_l(wstr wstr ptr) +@ cdecl _wcsdup(wstr) +@ cdecl _wcserror(long) +@ cdecl _wcserror_s(ptr long long) +@ cdecl _wcsftime_l(ptr long wstr ptr ptr) +@ cdecl _wcsicmp(wstr wstr) +@ cdecl _wcsicmp_l(wstr wstr ptr) +@ cdecl _wcsicoll(wstr wstr) +@ cdecl _wcsicoll_l(wstr wstr ptr) +@ cdecl _wcslwr(wstr) +@ cdecl _wcslwr_l(wstr ptr) +@ cdecl _wcslwr_s(wstr long) +@ cdecl _wcslwr_s_l(wstr long ptr) +@ cdecl _wcsncoll(wstr wstr long) +@ cdecl _wcsncoll_l(wstr wstr long ptr) +@ cdecl _wcsnicmp(wstr wstr long) +@ cdecl _wcsnicmp_l(wstr wstr long ptr) +@ cdecl _wcsnicoll(wstr wstr long) +@ cdecl _wcsnicoll_l(wstr wstr long ptr) +@ cdecl _wcsnset(wstr long long) +@ cdecl _wcsnset_s(wstr long long long) +@ cdecl _wcsrev(wstr) +@ cdecl _wcsset(wstr long) +@ cdecl _wcsset_s(wstr long long) +@ cdecl _wcstod_l(wstr ptr ptr) +@ cdecl _wcstof_l(wstr ptr ptr) +@ cdecl -ret64 _wcstoi64(wstr ptr long) +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) +@ stub _wcstoimax_l +@ cdecl _wcstol_l(wstr ptr long ptr) +@ cdecl _wcstold_l(wstr ptr ptr) _wcstod_l +@ cdecl -ret64 _wcstoll_l(wstr ptr long ptr) _wcstoi64_l +@ cdecl _wcstombs_l(ptr ptr long ptr) +@ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) +@ cdecl -ret64 _wcstoui64(wstr ptr long) +@ cdecl -ret64 _wcstoui64_l(wstr ptr long ptr) +@ cdecl _wcstoul_l(wstr ptr long ptr) +@ cdecl -ret64 _wcstoull_l(wstr ptr long ptr) _wcstoui64_l +@ stub _wcstoumax_l +@ cdecl _wcsupr(wstr) +@ cdecl _wcsupr_l(wstr ptr) +@ cdecl _wcsupr_s(wstr long) +@ cdecl _wcsupr_s_l(wstr long ptr) +@ cdecl _wcsxfrm_l(ptr wstr long ptr) +@ cdecl _wctime32(ptr) +@ cdecl _wctime32_s(ptr long ptr) +@ cdecl _wctime64(ptr) +@ cdecl _wctime64_s(ptr long ptr) +@ cdecl _wctomb_l(ptr long ptr) +@ cdecl _wctomb_s_l(ptr ptr long long ptr) +@ extern _wctype MSVCRT__wctype +@ cdecl _wdupenv_s(ptr ptr wstr) +@ varargs _wexecl(wstr wstr) +@ varargs _wexecle(wstr wstr) +@ varargs _wexeclp(wstr wstr) +@ varargs _wexeclpe(wstr wstr) +@ cdecl _wexecv(wstr ptr) +@ cdecl _wexecve(wstr ptr ptr) +@ cdecl _wexecvp(wstr ptr) +@ cdecl _wexecvpe(wstr ptr ptr) +@ cdecl _wfdopen(long wstr) +@ cdecl _wfindfirst32(wstr ptr) +@ stub _wfindfirst32i64 +@ cdecl _wfindfirst64(wstr ptr) +@ cdecl _wfindfirst64i32(wstr ptr) +@ cdecl _wfindnext32(long ptr) +@ stub _wfindnext32i64 +@ cdecl _wfindnext64(long ptr) +@ cdecl _wfindnext64i32(long ptr) +@ cdecl _wfopen(wstr wstr) +@ cdecl _wfopen_s(ptr wstr wstr) +@ cdecl _wfreopen(wstr wstr ptr) +@ cdecl _wfreopen_s(ptr wstr wstr ptr) +@ cdecl _wfsopen(wstr wstr long) +@ cdecl _wfullpath(ptr wstr long) +@ cdecl _wgetcwd(wstr long) +@ cdecl _wgetdcwd(long wstr long) +@ cdecl _wgetenv(wstr) +@ cdecl _wgetenv_s(ptr ptr long wstr) +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) +@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) +@ cdecl _wmkdir(wstr) +@ cdecl _wmktemp(wstr) +@ cdecl _wmktemp_s(wstr long) +@ varargs _wopen(wstr long) +@ cdecl _wperror(wstr) +@ cdecl _wpopen(wstr wstr) +@ cdecl _wputenv(wstr) +@ cdecl _wputenv_s(wstr wstr) +@ cdecl _wremove(wstr) +@ cdecl _wrename(wstr wstr) +@ cdecl _write(long ptr long) +@ cdecl _wrmdir(wstr) +@ cdecl _wsearchenv(wstr wstr ptr) +@ cdecl _wsearchenv_s(wstr wstr ptr long) +@ cdecl _wsetlocale(long wstr) +@ varargs _wsopen(wstr long long) +@ cdecl _wsopen_dispatch(wstr long long long ptr long) +@ cdecl _wsopen_s(ptr wstr long long long) +@ varargs _wspawnl(long wstr wstr) +@ varargs _wspawnle(long wstr wstr) +@ varargs _wspawnlp(long wstr wstr) +@ varargs _wspawnlpe(long wstr wstr) +@ cdecl _wspawnv(long wstr ptr) +@ cdecl _wspawnve(long wstr ptr ptr) +@ cdecl _wspawnvp(long wstr ptr) +@ cdecl _wspawnvpe(long wstr ptr ptr) +@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) +@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) +@ cdecl _wstat32(wstr ptr) +@ cdecl _wstat32i64(wstr ptr) +@ cdecl _wstat64(wstr ptr) +@ cdecl _wstat64i32(wstr ptr) +@ cdecl _wstrdate(ptr) +@ cdecl _wstrdate_s(ptr long) +@ cdecl _wstrtime(ptr) +@ cdecl _wstrtime_s(ptr long) +@ cdecl _wsystem(wstr) +@ cdecl _wtempnam(wstr wstr) +@ cdecl _wtmpnam(ptr) +@ cdecl _wtmpnam_s(ptr long) +@ cdecl _wtof(wstr) +@ cdecl _wtof_l(wstr ptr) +@ cdecl _wtoi(wstr) +@ cdecl -ret64 _wtoi64(wstr) +@ cdecl -ret64 _wtoi64_l(wstr ptr) +@ cdecl _wtoi_l(wstr ptr) +@ cdecl _wtol(wstr) +@ cdecl _wtol_l(wstr ptr) +@ cdecl -ret64 _wtoll(wstr) +@ cdecl -ret64 _wtoll_l(wstr ptr) +@ cdecl _wunlink(wstr) +@ cdecl _wutime32(wstr ptr) +@ cdecl _wutime64(wstr ptr) +@ cdecl _y0(double) +@ cdecl _y1(double) +@ cdecl _yn(long double) +@ cdecl abort() +@ cdecl abs(long) +@ cdecl acos(double) +@ cdecl -arch=!i386 acosf(float) +@ cdecl acosh(double) +@ cdecl acoshf(float) +@ cdecl acoshl(double) acosh +@ cdecl asctime(ptr) +@ cdecl asctime_s(ptr long ptr) +@ cdecl asin(double) +@ cdecl -arch=!i386 asinf(float) +@ cdecl asinh(double) +@ cdecl asinhf(float) +@ cdecl asinhl(double) asinh +@ cdecl atan(double) +@ cdecl atan2(double double) +@ cdecl -arch=!i386 atan2f(float float) +@ cdecl -arch=!i386 atanf(float) +@ cdecl atanh(double) +@ cdecl atanhf(float) +@ cdecl atanhl(double) atanh +@ cdecl atof(str) +@ cdecl atoi(str) +@ cdecl atol(str) +@ cdecl -ret64 atoll(str) +@ cdecl bsearch(ptr ptr long long ptr) +@ cdecl bsearch_s(ptr ptr long long ptr ptr) +@ cdecl btowc(long) +@ stub c16rtomb +@ stub c32rtomb +@ stub cabs +@ stub cabsf +@ stub cabsl +@ stub cacos +@ stub cacosf +@ stub cacosh +@ stub cacoshf +@ stub cacoshl +@ stub cacosl +@ cdecl calloc(long long) +@ stub carg +@ stub cargf +@ stub cargl +@ stub casin +@ stub casinf +@ stub casinh +@ stub casinhf +@ stub casinhl +@ stub casinl +@ stub catan +@ stub catanf +@ stub catanh +@ stub catanhf +@ stub catanhl +@ stub catanl +@ cdecl cbrt(double) +@ cdecl cbrtf(float) +@ cdecl cbrtl(double) cbrt +@ stub ccos +@ stub ccosf +@ stub ccosh +@ stub ccoshf +@ stub ccoshl +@ stub ccosl +@ cdecl ceil(double) +@ cdecl -arch=!i386 ceilf(float) +@ stub cexp +@ stub cexpf +@ stub cexpl +@ stub cimag +@ stub cimagf +@ stub cimagl +@ cdecl clearerr(ptr) +@ cdecl clearerr_s(ptr) +@ cdecl clock() +@ stub clog +@ stub clog10 +@ stub clog10f +@ stub clog10l +@ stub clogf +@ stub clogl +@ stub conj +@ stub conjf +@ stub conjl +@ cdecl copysign(double double) _copysign +@ cdecl copysignf(float float) _copysignf +@ cdecl copysignl(double double) _copysign +@ cdecl cos(double) +@ cdecl -arch=!i386 cosf(float) +@ cdecl cosh(double) +@ cdecl -arch=!i386 coshf(float) +@ stub cpow +@ stub cpowf +@ stub cpowl +@ stub cproj +@ stub cprojf +@ stub cprojl +@ cdecl creal(int128) MSVCR120_creal +@ stub crealf +@ stub creall +@ stub csin +@ stub csinf +@ stub csinh +@ stub csinhf +@ stub csinhl +@ stub csinl +@ stub csqrt +@ stub csqrtf +@ stub csqrtl +@ stub ctan +@ stub ctanf +@ stub ctanh +@ stub ctanhf +@ stub ctanhl +@ stub ctanl +@ cdecl -ret64 div(long long) +@ cdecl erf(double) +@ cdecl erfc(double) +@ cdecl erfcf(float) +@ cdecl erfcl(double) erfc +@ cdecl erff(float) +@ cdecl erfl(double) erf +@ cdecl exit(long) +@ cdecl exp(double) +@ cdecl exp2(double) +@ cdecl exp2f(float) +@ cdecl exp2l(double) exp2 +@ cdecl -arch=!i386 expf(float) +@ cdecl expm1(double) +@ cdecl expm1f(float) +@ cdecl expm1l(double) expm1 +@ cdecl fabs(double) +@ cdecl -arch=arm,arm64 fabsf(float) +@ cdecl fclose(ptr) +@ cdecl fdim(double double) +@ cdecl fdimf(float float) +@ cdecl fdiml(double double) fdim +@ stub feclearexcept +@ cdecl fegetenv(ptr) +@ stub fegetexceptflag +@ cdecl fegetround() +@ stub feholdexcept +@ cdecl feof(ptr) +@ cdecl ferror(ptr) +@ cdecl fesetenv(ptr) +@ stub fesetexceptflag +@ cdecl fesetround(long) +@ stub fetestexcept +@ cdecl fflush(ptr) +@ cdecl fgetc(ptr) +@ cdecl fgetpos(ptr ptr) +@ cdecl fgets(ptr long ptr) +@ cdecl fgetwc(ptr) +@ cdecl fgetws(ptr long ptr) +@ cdecl floor(double) +@ cdecl -arch=!i386 floorf(float) +@ cdecl fma(double double double) +@ cdecl fmaf(float float float) +@ cdecl fmal(double double double) fma +@ cdecl fmax(double double) +@ cdecl fmaxf(float float) +@ cdecl fmaxl(double double) fmax +@ cdecl fmin(double double) +@ cdecl fminf(float float) +@ cdecl fminl(double double) fmin +@ cdecl fmod(double double) +@ cdecl -arch=!i386 fmodf(float float) +@ cdecl fopen(str str) +@ cdecl fopen_s(ptr str str) +@ cdecl fputc(long ptr) +@ cdecl fputs(str ptr) +@ cdecl fputwc(long ptr) +@ cdecl fputws(wstr ptr) +@ cdecl fread(ptr long long ptr) +@ cdecl fread_s(ptr long long long ptr) +@ cdecl free(ptr) +@ cdecl freopen(str str ptr) +@ cdecl freopen_s(ptr str str ptr) +@ cdecl frexp(double ptr) +@ cdecl fseek(ptr long long) +@ cdecl fsetpos(ptr ptr) +@ cdecl ftell(ptr) +@ cdecl fwrite(ptr long long ptr) +@ cdecl getc(ptr) +@ cdecl getchar() +@ cdecl getenv(str) +@ cdecl getenv_s(ptr ptr long str) +@ cdecl gets(str) +@ cdecl gets_s(ptr long) +@ cdecl getwc(ptr) +@ cdecl getwchar() +@ cdecl hypot(double double) _hypot +@ cdecl ilogb(double) +@ cdecl ilogbf(float) +@ cdecl ilogbl(double) ilogb +@ cdecl -ret64 imaxabs(int64) +@ stub imaxdiv +@ cdecl is_wctype(long long) iswctype +@ cdecl isalnum(long) +@ cdecl isalpha(long) +@ cdecl isblank(long) +@ cdecl iscntrl(long) +@ cdecl isdigit(long) +@ cdecl isgraph(long) +@ cdecl isleadbyte(long) +@ cdecl islower(long) +@ cdecl isprint(long) +@ cdecl ispunct(long) +@ cdecl isspace(long) +@ cdecl isupper(long) +@ cdecl iswalnum(long) +@ cdecl iswalpha(long) +@ cdecl iswascii(long) +@ cdecl iswblank(long) +@ cdecl iswcntrl(long) +@ cdecl iswctype(long long) +@ cdecl iswdigit(long) +@ cdecl iswgraph(long) +@ cdecl iswlower(long) +@ cdecl iswprint(long) +@ cdecl iswpunct(long) +@ cdecl iswspace(long) +@ cdecl iswupper(long) +@ cdecl iswxdigit(long) +@ cdecl isxdigit(long) +@ cdecl labs(long) +@ cdecl ldexp(double long) +@ cdecl -ret64 ldiv(long long) +@ cdecl lgamma(double) +@ cdecl lgammaf(float) +@ cdecl lgammal(double) lgamma +@ cdecl -ret64 llabs(int64) +@ cdecl -norelay lldiv(int64 int64) +@ cdecl -ret64 llrint(double) +@ cdecl -ret64 llrintf(float) +@ cdecl -ret64 llrintl(double) llrint +@ cdecl -ret64 llround(double) +@ cdecl -ret64 llroundf(float) +@ cdecl -ret64 llroundl(double) llround +@ cdecl localeconv() +@ cdecl log(double) +@ cdecl log10(double) +@ cdecl -arch=!i386 log10f(float) +@ cdecl log1p(double) +@ cdecl log1pf(float) +@ cdecl log1pl(double) log1p +@ cdecl log2(double) +@ cdecl log2f(float) +@ cdecl log2l(double) log2 +@ cdecl logb(double) _logb +@ cdecl logbf(float) _logbf +@ cdecl logbl(double) _logb +@ cdecl -arch=!i386 logf(float) +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp +@ cdecl lrint(double) +@ cdecl lrintf(float) +@ cdecl lrintl(double) lrint +@ cdecl lround(double) +@ cdecl lroundf(float) +@ cdecl lroundl(double) lround +@ cdecl malloc(long) +@ cdecl mblen(ptr long) +@ cdecl mbrlen(ptr long ptr) +@ stub mbrtoc16 +@ stub mbrtoc32 +@ cdecl mbrtowc(ptr str long ptr) +@ cdecl mbsrtowcs(ptr ptr long ptr) +@ cdecl mbsrtowcs_s(ptr ptr long ptr long ptr) +@ cdecl mbstowcs(ptr str long) +@ cdecl mbstowcs_s(ptr ptr long str long) _mbstowcs_s +@ cdecl mbtowc(ptr str long) +@ cdecl memchr(ptr long long) +@ cdecl memcmp(ptr ptr long) +@ cdecl memcpy(ptr ptr long) +@ cdecl memcpy_s(ptr long ptr long) +@ cdecl memmove(ptr ptr long) +@ cdecl memmove_s(ptr long ptr long) +@ cdecl memset(ptr long long) +@ cdecl modf(double ptr) +@ cdecl -arch=!i386 modff(float ptr) +@ cdecl nan(str) +@ cdecl nanf(str) +@ cdecl nanl(str) nan +@ cdecl nearbyint(double) +@ cdecl nearbyintf(float) +@ cdecl nearbyintl(double) nearbyint +@ cdecl nextafter(double double) _nextafter +@ cdecl nextafterf(float float) _nextafterf +@ cdecl nextafterl(double double) _nextafter +@ cdecl nexttoward(double double) MSVCRT_nexttoward +@ cdecl nexttowardf(float double) MSVCRT_nexttowardf +@ cdecl nexttowardl(double double) MSVCRT_nexttoward +@ stub norm +@ stub normf +@ stub norml +@ cdecl perror(str) +@ cdecl pow(double double) +@ cdecl -arch=!i386 powf(float float) +@ cdecl putc(long ptr) +@ cdecl putchar(long) +@ cdecl puts(str) +@ cdecl putwc(long ptr) fputwc +@ cdecl putwchar(long) _fputwchar +@ cdecl qsort(ptr long long ptr) +@ cdecl qsort_s(ptr long long ptr ptr) +@ cdecl quick_exit(long) +@ cdecl raise(long) +@ cdecl rand() +@ cdecl rand_s(ptr) +@ cdecl realloc(ptr long) +@ cdecl remainder(double double) +@ cdecl remainderf(float float) +@ cdecl remainderl(double double) remainder +@ cdecl remove(str) +@ cdecl remquo(double double ptr) +@ cdecl remquof(float float ptr) +@ cdecl remquol(double double ptr) remquo +@ cdecl rename(str str) +@ cdecl rewind(ptr) +@ cdecl rint(double) +@ cdecl rintf(float) +@ cdecl rintl(double) rint +@ cdecl round(double) +@ cdecl roundf(float) +@ cdecl roundl(double) round +@ cdecl scalbln(double long) _scalb +@ cdecl scalblnf(float long) _scalbf +@ cdecl scalblnl(double long) _scalb +@ cdecl scalbn(double long) _scalb +@ cdecl scalbnf(float long) _scalbf +@ cdecl scalbnl(double long) _scalb +@ cdecl set_terminate(ptr) +@ cdecl set_unexpected(ptr) +@ cdecl setbuf(ptr ptr) +@ cdecl -arch=arm,x86_64 -norelay -private setjmp(ptr) MSVCRT__setjmp +@ cdecl setlocale(long str) +@ cdecl setvbuf(ptr str long long) +@ cdecl signal(long long) +@ cdecl sin(double) +@ cdecl -arch=!i386 sinf(float) +@ cdecl sinh(double) +@ cdecl -arch=!i386 sinhf(float) +@ cdecl sqrt(double) +@ cdecl -arch=!i386 sqrtf(float) +@ cdecl srand(long) +@ cdecl strcat(str str) +@ cdecl strcat_s(str long str) +@ cdecl strchr(str long) +@ cdecl strcmp(str str) +@ cdecl strcoll(str str) +@ cdecl strcpy(ptr str) +@ cdecl strcpy_s(ptr long str) +@ cdecl strcspn(str str) +@ cdecl strerror(long) +@ cdecl strerror_s(ptr long long) +@ cdecl strftime(ptr long str ptr) +@ cdecl strlen(str) +@ cdecl strncat(str str long) +@ cdecl strncat_s(str long str long) +@ cdecl strncmp(str str long) +@ cdecl strncpy(ptr str long) +@ cdecl strncpy_s(ptr long str long) +@ cdecl strnlen(str long) +@ cdecl strpbrk(str str) +@ cdecl strrchr(str long) +@ cdecl strspn(str str) ntdll.strspn +@ cdecl strstr(str str) +@ cdecl strtod(str ptr) +@ cdecl strtof(str ptr) +@ cdecl -ret64 strtoimax(str ptr long) _strtoi64 +@ cdecl strtok(str str) +@ cdecl strtok_s(ptr str ptr) +@ cdecl strtol(str ptr long) +@ cdecl strtold(str ptr) strtod +@ cdecl -ret64 strtoll(str ptr long) _strtoi64 +@ cdecl strtoul(str ptr long) +@ cdecl -ret64 strtoull(str ptr long) _strtoui64 +@ cdecl -ret64 strtoumax(str ptr long) _strtoui64 +@ cdecl strxfrm(ptr str long) +@ cdecl system(str) +@ cdecl tan(double) +@ cdecl -arch=!i386 tanf(float) +@ cdecl tanh(double) +@ cdecl -arch=!i386 tanhf(float) +@ cdecl terminate() +@ cdecl tgamma(double) +@ cdecl tgammaf(float) +@ cdecl tgammal(double) tgamma +@ cdecl tmpfile() +@ cdecl tmpfile_s(ptr) +@ cdecl tmpnam(ptr) +@ cdecl tmpnam_s(ptr long) +@ cdecl tolower(long) +@ cdecl toupper(long) +@ cdecl towctrans(long long) +@ cdecl towlower(long) +@ cdecl towupper(long) +@ cdecl trunc(double) +@ cdecl truncf(float) +@ cdecl truncl(double) trunc +@ stub unexpected +@ cdecl ungetc(long ptr) +@ cdecl ungetwc(long ptr) +@ cdecl wcrtomb(ptr long ptr) +@ cdecl wcrtomb_s(ptr ptr long long ptr) +@ cdecl wcscat(wstr wstr) +@ cdecl wcscat_s(wstr long wstr) +@ cdecl wcschr(wstr long) +@ cdecl wcscmp(wstr wstr) +@ cdecl wcscoll(wstr wstr) +@ cdecl wcscpy(ptr wstr) +@ cdecl wcscpy_s(ptr long wstr) +@ cdecl wcscspn(wstr wstr) ntdll.wcscspn +@ cdecl wcsftime(ptr long wstr ptr) +@ cdecl wcslen(wstr) +@ cdecl wcsncat(wstr wstr long) ntdll.wcsncat +@ cdecl wcsncat_s(wstr long wstr long) +@ cdecl wcsncmp(wstr wstr long) +@ cdecl wcsncpy(ptr wstr long) +@ cdecl wcsncpy_s(ptr long wstr long) +@ cdecl wcsnlen(wstr long) +@ cdecl wcspbrk(wstr wstr) +@ cdecl wcsrchr(wstr long) +@ cdecl wcsrtombs(ptr ptr long ptr) +@ cdecl wcsrtombs_s(ptr ptr long ptr long ptr) +@ cdecl wcsspn(wstr wstr) ntdll.wcsspn +@ cdecl wcsstr(wstr wstr) +@ cdecl wcstod(wstr ptr) +@ cdecl wcstof(ptr ptr) +@ stub wcstoimax +@ cdecl wcstok(wstr wstr ptr) +@ cdecl wcstok_s(ptr wstr ptr) +@ cdecl wcstol(wstr ptr long) +@ cdecl wcstold(wstr ptr) wcstod +@ cdecl -ret64 wcstoll(wstr ptr long) _wcstoi64 +@ cdecl wcstombs(ptr ptr long) +@ cdecl wcstombs_s(ptr ptr long wstr long) +@ cdecl wcstoul(wstr ptr long) +@ cdecl -ret64 wcstoull(wstr ptr long) _wcstoui64 +@ stub wcstoumax +@ cdecl wcsxfrm(ptr wstr long) +@ cdecl wctob(long) +@ cdecl wctomb(ptr long) +@ cdecl wctomb_s(ptr ptr long long) +@ cdecl wctrans(str) +@ cdecl wctype(str) +@ cdecl wmemcpy_s(ptr long ptr long) +@ cdecl wmemmove_s(ptr long ptr long) diff --git a/wrappers/new-dlls/ucrtbase/version.rc b/wrappers/new-dlls/ucrtbase/version.rc new file mode 100644 index 00000000000..f034bc39ef6 --- /dev/null +++ b/wrappers/new-dlls/ucrtbase/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Louis Lenders + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine runtime library" +#define WINE_FILENAME_STR "ucrtbase.dll" +#define WINE_FILEVERSION 10,0,14393,2247 +#define WINE_FILEVERSION_STR "10.0.14393.2247" +#define WINE_PRODUCTVERSION 10,0,14393,2247 +#define WINE_PRODUCTVERSION_STR "10.0.14393.2247" + +#include "wine/wine_common_ver.rc" diff --git a/wrappers/new-dlls/uianimation/Makefile.in b/wrappers/new-dlls/uianimation/Makefile.in new file mode 100644 index 00000000000..d492faabde8 --- /dev/null +++ b/wrappers/new-dlls/uianimation/Makefile.in @@ -0,0 +1,11 @@ +MODULE = uianimation.dll +IMPORTS = uuid + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + main.c + +IDL_SRCS = \ + uianimation_reg.idl \ + uianimation_typelib.idl diff --git a/wrappers/new-dlls/uianimation/main.c b/wrappers/new-dlls/uianimation/main.c new file mode 100644 index 00000000000..c0c7367e092 --- /dev/null +++ b/wrappers/new-dlls/uianimation/main.c @@ -0,0 +1,1227 @@ +/* + * Uianimation main file. + * + * Copyright (C) 2018 Louis Lenders + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#define COBJMACROS + +#include + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" +#include "oaidl.h" +#include "ocidl.h" + +#include "initguid.h" +#include "uianimation.h" + +#include "wine/heap.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(uianimation); + +static HINSTANCE hinstance; + +BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved ) +{ + TRACE("(%p %d %p)\n", dll, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + hinstance = dll; + DisableThreadLibraryCalls( dll ); + break; + } + return TRUE; +} + +struct class_factory +{ + IClassFactory IClassFactory_iface; + HRESULT (*create_instance)(IUnknown *, REFIID, void **); +}; + +static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface ); +} + +static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, REFIID iid, void **obj ) +{ + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IClassFactory )) + { + IClassFactory_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI class_factory_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI class_factory_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface, + IUnknown *outer, REFIID iid, + void **obj ) +{ + struct class_factory *This = impl_from_IClassFactory( iface ); + + TRACE( "%p %s %p\n", outer, debugstr_guid( iid ), obj ); + + *obj = NULL; + return This->create_instance( outer, iid, obj ); +} + +static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface, + BOOL lock ) +{ + FIXME( "%d: stub!\n", lock ); + return S_OK; +} + +static const struct IClassFactoryVtbl class_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + class_factory_CreateInstance, + class_factory_LockServer +}; + +/*********************************************************************** + * IUIAnimationStoryboard + */ +struct animation_storyboard +{ + IUIAnimationStoryboard IUIAnimationStoryboard_iface; + LONG ref; +}; + +struct animation_storyboard *impl_from_IUIAnimationStoryboard( IUIAnimationStoryboard *iface ) +{ + return CONTAINING_RECORD( iface, struct animation_storyboard, IUIAnimationStoryboard_iface ); +} + +static HRESULT WINAPI animation_storyboard_QueryInterface( IUIAnimationStoryboard *iface, + REFIID iid, void **obj ) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationStoryboard )) + { + IUIAnimationStoryboard_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI animation_storyboard_AddRef( IUIAnimationStoryboard *iface ) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI animation_storyboard_Release( IUIAnimationStoryboard *iface ) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI animation_storyboard_AddTransition (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable, + IUIAnimationTransition *transition) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI animation_storyboard_AddKeyframeAtOffset (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME existingframe, + UI_ANIMATION_SECONDS offset, UI_ANIMATION_KEYFRAME *keyframe) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_AddKeyframeAfterTransition (IUIAnimationStoryboard *iface,IUIAnimationTransition *transition, + UI_ANIMATION_KEYFRAME *keyframe) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI animation_storyboard_AddTransitionAtKeyframe (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable, + IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_AddTransitionBetweenKeyframes (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable, + IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key, UI_ANIMATION_KEYFRAME end_key) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_RepeatBetweenKeyframes (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME start_key, + UI_ANIMATION_KEYFRAME end_key, INT32 count) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI animation_storyboard_HoldVariable (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_SetLongestAcceptableDelay (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS delay) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_Schedule (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS now, + UI_ANIMATION_SCHEDULING_RESULT *result) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return 0; +} + +static HRESULT WINAPI animation_storyboard_Conclude (IUIAnimationStoryboard *iface) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_Finish (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS deadline) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_Abandon (IUIAnimationStoryboard *iface) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_SetTag(IUIAnimationStoryboard *iface, IUnknown *object, UINT32 id) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_GetTag (IUIAnimationStoryboard *iface, IUnknown **object, UINT32 *id) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_GetStatus (IUIAnimationStoryboard *iface, UI_ANIMATION_STORYBOARD_STATUS *status) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_GetElapsedTime (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS *elapsed) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_storyboard_SetStoryboardEventHandler (IUIAnimationStoryboard *iface, IUIAnimationStoryboardEventHandler *handler) +{ + struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +const struct IUIAnimationStoryboardVtbl animation_storyboard_vtbl = +{ + animation_storyboard_QueryInterface, + animation_storyboard_AddRef, + animation_storyboard_Release, + animation_storyboard_AddTransition, + animation_storyboard_AddKeyframeAtOffset, + animation_storyboard_AddKeyframeAfterTransition, + animation_storyboard_AddTransitionAtKeyframe, + animation_storyboard_AddTransitionBetweenKeyframes, + animation_storyboard_RepeatBetweenKeyframes, + animation_storyboard_HoldVariable, + animation_storyboard_SetLongestAcceptableDelay, + animation_storyboard_Schedule , + animation_storyboard_Conclude , + animation_storyboard_Finish , + animation_storyboard_Abandon, + animation_storyboard_SetTag, + animation_storyboard_GetTag , + animation_storyboard_GetStatus , + animation_storyboard_GetElapsedTime, + animation_storyboard_SetStoryboardEventHandler +}; + +static HRESULT animation_storyboard_create( IUIAnimationStoryboard **obj ) +{ + struct animation_storyboard *This = heap_alloc( sizeof(*This) ); + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationStoryboard_iface.lpVtbl = &animation_storyboard_vtbl; + This->ref = 1; + + *obj = &This->IUIAnimationStoryboard_iface; + + return S_OK; +} + +/*********************************************************************** + * IUIAnimationVariable + */ +struct animation_var +{ + IUIAnimationVariable IUIAnimationVariable_iface; + LONG ref; + DOUBLE initial; +}; + +struct animation_var *impl_from_IUIAnimationVariable( IUIAnimationVariable *iface ) +{ + return CONTAINING_RECORD( iface, struct animation_var, IUIAnimationVariable_iface ); +} + +static HRESULT WINAPI animation_var_QueryInterface( IUIAnimationVariable *iface, + REFIID iid, void **obj ) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationVariable )) + { + IUIAnimationVariable_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI animation_var_AddRef( IUIAnimationVariable *iface ) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI animation_var_Release( IUIAnimationVariable *iface ) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI animation_var_GetValue ( IUIAnimationVariable *iface, DOUBLE *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetFinalValue ( IUIAnimationVariable *iface, DOUBLE *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetPreviousValue ( IUIAnimationVariable *iface, DOUBLE *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetIntegerValue ( IUIAnimationVariable *iface, INT32 *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetFinalIntegerValue ( IUIAnimationVariable *iface, INT32 *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetPreviousIntegerValue ( IUIAnimationVariable *iface, INT32 *value) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetCurrentStoryboard ( IUIAnimationVariable *iface, IUIAnimationStoryboard **storyboard) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_SetLowerBound ( IUIAnimationVariable *iface, DOUBLE bound) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_SetUpperBound ( IUIAnimationVariable *iface, DOUBLE bound) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_SetRoundingMode ( IUIAnimationVariable *iface,UI_ANIMATION_ROUNDING_MODE mode) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI animation_var_SetTag ( IUIAnimationVariable *iface, IUnknown *object, UINT32 id) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_GetTag ( IUIAnimationVariable *iface, IUnknown **object, UINT32 *id) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_var_SetVariableChangeHandler ( IUIAnimationVariable *iface, IUIAnimationVariableChangeHandler *handler) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI animation_var_SetVariableIntegerChangeHandler ( IUIAnimationVariable *iface, + IUIAnimationVariableIntegerChangeHandler *handler) +{ + struct animation_var *This = impl_from_IUIAnimationVariable( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +const struct IUIAnimationVariableVtbl animation_var_vtbl = +{ + animation_var_QueryInterface, + animation_var_AddRef, + animation_var_Release, + animation_var_GetValue, + animation_var_GetFinalValue, + animation_var_GetPreviousValue, + animation_var_GetIntegerValue, + animation_var_GetFinalIntegerValue, + animation_var_GetPreviousIntegerValue, + animation_var_GetCurrentStoryboard, + animation_var_SetLowerBound, + animation_var_SetUpperBound, + animation_var_SetRoundingMode, + animation_var_SetTag, + animation_var_GetTag, + animation_var_SetVariableChangeHandler, + animation_var_SetVariableIntegerChangeHandler, +}; + +static HRESULT animation_var_create(DOUBLE initial, IUIAnimationVariable **obj ) +{ + struct animation_var *This = heap_alloc( sizeof(*This) ); + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationVariable_iface.lpVtbl = &animation_var_vtbl; + This->ref = 1; + This->initial = initial; + + *obj = &This->IUIAnimationVariable_iface; + + return S_OK; +} + +/*********************************************************************** + * IUIAnimationManager + */ +struct manager +{ + IUIAnimationManager IUIAnimationManager_iface; + LONG ref; +}; + +struct manager *impl_from_IUIAnimationManager( IUIAnimationManager *iface ) +{ + return CONTAINING_RECORD( iface, struct manager, IUIAnimationManager_iface ); +} + +static HRESULT WINAPI manager_QueryInterface( IUIAnimationManager *iface, REFIID iid, void **obj ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationManager )) + { + IUIAnimationManager_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI manager_AddRef( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI manager_Release( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + { + heap_free( This ); + } + + return ref; +} + +static HRESULT WINAPI manager_CreateAnimationVariable( IUIAnimationManager *iface, DOUBLE initial_value, IUIAnimationVariable **variable ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + TRACE( "(%p)->(%f, %p)\n", This, initial_value, variable ); + return animation_var_create(initial_value, variable); +} + +static HRESULT WINAPI manager_ScheduleTransition( IUIAnimationManager *iface, IUIAnimationVariable *variable, IUIAnimationTransition *transition, UI_ANIMATION_SECONDS current_time ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p, %p)\n", This, variable, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_CreateStoryboard( IUIAnimationManager *iface, IUIAnimationStoryboard **storyboard ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + TRACE( "(%p)->(%p)\n", This, storyboard ); + return animation_storyboard_create(storyboard); +} + +static HRESULT WINAPI manager_FinishAllStoryboards( IUIAnimationManager *iface, UI_ANIMATION_SECONDS max_time ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%f)\n", This, max_time ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_AbandonAllStoryboards( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Update( IUIAnimationManager *iface, UI_ANIMATION_SECONDS cur_time, UI_ANIMATION_UPDATE_RESULT *update_result ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%f, %p)\n", This, cur_time, update_result ); + if (update_result) + *update_result = UI_ANIMATION_UPDATE_VARIABLES_CHANGED; + return S_OK; +} + +static HRESULT WINAPI manager_GetVariableFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationVariable **variable ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p, %p)\n", This, object, variable ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_GetStoryboardFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationStoryboard **storyboard ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p, %d, %p)\n", This, object, id, storyboard ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_GetStatus( IUIAnimationManager *iface, UI_ANIMATION_MANAGER_STATUS *status ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, status ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetAnimationMode( IUIAnimationManager *iface, UI_ANIMATION_MODE mode ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%d)\n", This, mode ); + return S_OK; +} + +static HRESULT WINAPI manager_Pause( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Resume( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetManagerEventHandler( IUIAnimationManager *iface, IUIAnimationManagerEventHandler *handler ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, handler ); + return S_OK; +} + +static HRESULT WINAPI manager_SetCancelPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, comparison ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetTrimPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, comparison ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetCompressPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, comparison ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetConcludePriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%p)\n", This, comparison ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager *iface, UI_ANIMATION_SECONDS delay ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->(%f)\n", This, delay ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Shutdown( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationManagerVtbl manager_vtbl = +{ + manager_QueryInterface, + manager_AddRef, + manager_Release, + manager_CreateAnimationVariable, + manager_ScheduleTransition, + manager_CreateStoryboard, + manager_FinishAllStoryboards, + manager_AbandonAllStoryboards, + manager_Update, + manager_GetVariableFromTag, + manager_GetStoryboardFromTag, + manager_GetStatus, + manager_SetAnimationMode, + manager_Pause, + manager_Resume, + manager_SetManagerEventHandler, + manager_SetCancelPriorityComparison, + manager_SetTrimPriorityComparison, + manager_SetCompressPriorityComparison, + manager_SetConcludePriorityComparison, + manager_SetDefaultLongestAcceptableDelay, + manager_Shutdown +}; + +static HRESULT manager_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct manager *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationManager_iface.lpVtbl = &manager_vtbl; + This->ref = 1; + + hr = IUIAnimationManager_QueryInterface( &This->IUIAnimationManager_iface, iid, obj ); + + IUIAnimationManager_Release( &This->IUIAnimationManager_iface ); + return hr; +} + +/*********************************************************************** + * IUIAnimationTimer + */ +struct timer +{ + IUIAnimationTimer IUIAnimationTimer_iface; + LONG ref; +}; + +struct timer *impl_from_IUIAnimationTimer( IUIAnimationTimer *iface ) +{ + return CONTAINING_RECORD( iface, struct timer, IUIAnimationTimer_iface ); +} + +static HRESULT WINAPI timer_QueryInterface( IUIAnimationTimer *iface, REFIID iid, void **obj ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTimer )) + { + IUIAnimationTimer_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI timer_AddRef( IUIAnimationTimer *iface ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI timer_Release( IUIAnimationTimer *iface ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI timer_SetTimerUpdateHandler (IUIAnimationTimer *iface, + IUIAnimationTimerUpdateHandler *update_handler, + UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->(%p, %d)\n", This, update_handler, idle_behaviour ); + return E_NOTIMPL; +} + + static HRESULT WINAPI timer_SetTimerEventHandler (IUIAnimationTimer *iface, + IUIAnimationTimerEventHandler *handler) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->()\n", This ); + return S_OK; +} + +static HRESULT WINAPI timer_Enable (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->()\n", This ); + return S_OK; +} + +static HRESULT WINAPI timer_Disable (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI timer_IsEnabled (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->()\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI timer_GetTime (IUIAnimationTimer *iface, UI_ANIMATION_SECONDS *seconds) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->(%p)\n", This, seconds ); + return S_OK; +} + +static HRESULT WINAPI timer_SetFrameRateThreshold (IUIAnimationTimer *iface, UINT32 frames_per_sec) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->(%d)\n", This, frames_per_sec ); + return E_NOTIMPL; +} + +const struct IUIAnimationTimerVtbl timer_vtbl = +{ + timer_QueryInterface, + timer_AddRef, + timer_Release, + timer_SetTimerUpdateHandler, + timer_SetTimerEventHandler, + timer_Enable, + timer_Disable, + timer_IsEnabled, + timer_GetTime, + timer_SetFrameRateThreshold, +}; + +static HRESULT timer_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct timer *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) + return E_OUTOFMEMORY; + This->IUIAnimationTimer_iface.lpVtbl = &timer_vtbl; + This->ref = 1; + + hr = IUIAnimationTimer_QueryInterface( &This->IUIAnimationTimer_iface, iid, obj ); + + IUIAnimationTimer_Release( &This->IUIAnimationTimer_iface ); + return hr; +} + +/*********************************************************************** + * IUIAnimationTransitionFactory + */ +struct tr_factory +{ + IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface; + LONG ref; +}; + +struct tr_factory *impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct tr_factory, IUIAnimationTransitionFactory_iface ); +} + +static HRESULT WINAPI tr_factory_QueryInterface( IUIAnimationTransitionFactory *iface, REFIID iid, void **obj ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTransitionFactory )) + { + IUIAnimationTransitionFactory_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI tr_factory_AddRef( IUIAnimationTransitionFactory *iface ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI tr_factory_Release( IUIAnimationTransitionFactory *iface ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI tr_factory_CreateTransition(IUIAnimationTransitionFactory *iface, + IUIAnimationInterpolator *interpolator, IUIAnimationTransition **transition) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + FIXME( "stub (%p)->(%p, %p)\n", This, interpolator, transition ); + return E_NOTIMPL; +} + +const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl = +{ + tr_factory_QueryInterface, + tr_factory_AddRef, + tr_factory_Release, + tr_factory_CreateTransition +}; + +static HRESULT transition_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct tr_factory *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTransitionFactory_iface.lpVtbl = &tr_factory_vtbl; + This->ref = 1; + + hr = IUIAnimationTransitionFactory_QueryInterface( &This->IUIAnimationTransitionFactory_iface, iid, obj ); + + IUIAnimationTransitionFactory_Release( &This->IUIAnimationTransitionFactory_iface ); + return hr; +} + +/*********************************************************************** + * IUITransitionLibrary + */ +struct tr_library +{ + IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface; + LONG ref; +}; + +struct tr_library *impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary *iface ) +{ + return CONTAINING_RECORD( iface, struct tr_library, IUIAnimationTransitionLibrary_iface ); +} + +static HRESULT WINAPI tr_library_QueryInterface( IUIAnimationTransitionLibrary *iface, + REFIID iid, void **obj ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTransitionLibrary )) + { + IUIAnimationTransitionLibrary_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI tr_library_AddRef( IUIAnimationTransitionLibrary *iface ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI tr_library_Release( IUIAnimationTransitionLibrary *iface ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary *iface, + double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %p)\n", This, finalValue, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary *iface, + double duration, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary *iface, + double delay, double finalValue, double hold, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary *iface, + double duration, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, finalValue, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary *iface, + double speed, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %p)\n", This, speed, finalValue, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary *iface, + double duration, double period, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, period, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary *iface, + double duration, double minimumValue, double maximumValue, double period, + UI_ANIMATION_SLOPE slope, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %f, %f, %d, %p)\n", This, duration, minimumValue, maximumValue, period, slope, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary *iface, + double duration, double finalValue, double accelerationRatio, double decelerationRatio, + IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %f, %f, %p)\n", This, duration, finalValue, accelerationRatio, decelerationRatio, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary *iface, double duration, + IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary *iface, double duration, + double finalValue, double finalVelocity, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %f, %p)\n", This, duration, finalValue, finalVelocity, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary *iface, + double maximumDuration, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->(%f, %f, %p)\n", This, maximumDuration, finalValue, transition ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary *iface, + double finalValue, double finalVelocity, double acceleration, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl = +{ + tr_library_QueryInterface, + tr_library_AddRef, + tr_library_Release, + tr_library_CreateInstantaneousTransition, + tr_library_CreateConstantTransition, + tr_library_CreateDiscreteTransition, + tr_library_CreateLinearTransition, + tr_library_CreateLinearTransitionFromSpeed, + tr_library_CreateSinusoidalTransitionFromVelocity, + tr_library_CreateSinusoidalTransitionFromRange, + tr_library_CreateAccelerateDecelerateTransition, + tr_library_CreateReversalTransition, + tr_library_CreateCubicTransition, + tr_library_CreateSmoothStopTransition, + tr_library_CreateParabolicTransitionFromAcceleration, +}; + +static HRESULT library_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct tr_library *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTransitionLibrary_iface.lpVtbl = &tr_library_vtbl; + This->ref = 1; + + hr = IUIAnimationTransitionLibrary_QueryInterface( &This->IUIAnimationTransitionLibrary_iface, iid, obj ); + + IUIAnimationTransitionLibrary_Release( &This->IUIAnimationTransitionLibrary_iface ); + return hr; +} + +static struct class_factory manager_cf = { { &class_factory_vtbl }, manager_create }; +static struct class_factory timer_cf = { { &class_factory_vtbl }, timer_create }; +static struct class_factory transition_cf = { { &class_factory_vtbl }, transition_create }; +static struct class_factory library_cf = { { &class_factory_vtbl }, library_create }; + +/****************************************************************** + * DllGetClassObject + */ +HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj ) +{ + IClassFactory *cf = NULL; + + TRACE( "(%s %s %p)\n", debugstr_guid( clsid ), debugstr_guid( iid ), obj ); + + if (IsEqualCLSID( clsid, &CLSID_UIAnimationManager )) + cf = &manager_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTimer )) + cf = &timer_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionFactory )) + cf = &transition_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionLibrary )) + cf = &library_cf.IClassFactory_iface; + + if (!cf) + return CLASS_E_CLASSNOTAVAILABLE; + + return IClassFactory_QueryInterface( cf, iid, obj ); +} + +/****************************************************************** + * DllCanUnloadNow + */ +HRESULT WINAPI DllCanUnloadNow( void ) +{ + TRACE( "()\n" ); + return S_FALSE; +} + +/*********************************************************************** + * DllRegisterServer + */ +HRESULT WINAPI DllRegisterServer( void ) +{ + return __wine_register_resources( hinstance ); +} + +/*********************************************************************** + * DllUnregisterServer + */ +HRESULT WINAPI DllUnregisterServer( void ) +{ + return __wine_unregister_resources( hinstance ); +} diff --git a/wrappers/new-dlls/uianimation/tests/Makefile.in b/wrappers/new-dlls/uianimation/tests/Makefile.in new file mode 100644 index 00000000000..ec1118c2fcd --- /dev/null +++ b/wrappers/new-dlls/uianimation/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = uianimation.dll +IMPORTS = ole32 + +C_SRCS = \ + uianimation.c diff --git a/wrappers/new-dlls/uianimation/tests/uianimation.c b/wrappers/new-dlls/uianimation/tests/uianimation.c new file mode 100644 index 00000000000..e8d113a6257 --- /dev/null +++ b/wrappers/new-dlls/uianimation/tests/uianimation.c @@ -0,0 +1,159 @@ +/* + * UI Animation tests + * + * Copyright 2019 Alistair Leslie-Hughes + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "windows.h" +#include "initguid.h" +#include "uianimation.h" + +#include "wine/test.h" + +static void test_UIAnimationManager(void) +{ + HRESULT hr; + IUIAnimationManager *manager; + IUIAnimationVariable *variable; + IUIAnimationStoryboard *storyboard; + + hr = CoCreateInstance( &CLSID_UIAnimationManager, NULL, CLSCTX_ALL, &IID_IUIAnimationManager, (LPVOID*)&manager); + if(FAILED(hr)) + { + win_skip("UIAnimationManager not found\n"); + return; + } + + hr = IUIAnimationManager_CreateAnimationVariable(manager, 1.0f, &variable); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + IUIAnimationVariable_Release(variable); + + hr = IUIAnimationManager_CreateStoryboard(manager, &storyboard); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + IUIAnimationStoryboard_Release(storyboard); + + IUIAnimationManager_Release(manager); +} + +static void test_IUIAnimationTimer(void) +{ + HRESULT hr; + IUIAnimationTimer *timer; + + hr = CoCreateInstance( &CLSID_UIAnimationTimer, NULL, CLSCTX_ALL, &IID_IUIAnimationTimer, (void**)&timer); + if(FAILED(hr)) + { + win_skip("IUIAnimationTimer not found\n"); + return; + } + + hr = IUIAnimationTimer_IsEnabled(timer); + todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_Enable(timer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_Enable(timer); + todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_IsEnabled(timer); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_Disable(timer); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_Disable(timer); + todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); + + hr = IUIAnimationTimer_IsEnabled(timer); + todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); + + IUIAnimationTimer_Release(timer); +} + +static void test_IUIAnimationTransitionFactory(void) +{ + HRESULT hr; + IUIAnimationTransitionFactory *factory; + IUIAnimationTransition *transition = NULL; + + hr = CoCreateInstance( &CLSID_UIAnimationTransitionFactory, NULL, CLSCTX_ALL, + &IID_IUIAnimationTransitionFactory, (void**)&factory); + if (FAILED(hr)) + { + win_skip("IUIAnimationTransitionFactory not found\n"); + return; + } + + hr = IUIAnimationTransitionFactory_CreateTransition(factory, NULL, &transition); + todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); + + IUIAnimationTransitionFactory_Release(factory); +} + +static void test_IUIAnimationTransitionLibrary(void) +{ + HRESULT hr; + IUIAnimationTransitionLibrary *library; + IUIAnimationTransition *instantaneous, *linear, *smooth; + + hr = CoCreateInstance( &CLSID_UIAnimationTransitionLibrary, NULL, CLSCTX_ALL, + &IID_IUIAnimationTransitionLibrary, (void**)&library); + if (FAILED(hr)) + { + win_skip("IUIAnimationTransitionLibrary not found\n"); + return; + } + + hr = IUIAnimationTransitionLibrary_CreateInstantaneousTransition(library, 100.0, &instantaneous); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + IUIAnimationTransition_Release(instantaneous); + + hr = IUIAnimationTransitionLibrary_CreateLinearTransition(library, 500.0, 100.0, &linear); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + IUIAnimationTransition_Release(linear); + + hr = IUIAnimationTransitionLibrary_CreateSmoothStopTransition(library, 500.0, 100.0, &smooth); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + IUIAnimationTransition_Release(smooth); + + IUIAnimationTransitionLibrary_Release(library); +} + +START_TEST(uianimation) +{ + HRESULT hr; + + hr = CoInitialize(0); + ok(hr == S_OK, "failed to init com\n"); + if(hr != S_OK) + return; + + test_UIAnimationManager(); + test_IUIAnimationTimer(); + test_IUIAnimationTransitionFactory(); + test_IUIAnimationTransitionLibrary(); + + CoUninitialize(); +} diff --git a/wrappers/new-dlls/uianimation/uianimation.spec b/wrappers/new-dlls/uianimation/uianimation.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/wrappers/new-dlls/uianimation/uianimation.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/wrappers/new-dlls/uianimation/uianimation_reg.idl b/wrappers/new-dlls/uianimation/uianimation_reg.idl new file mode 100644 index 00000000000..7b311b50df1 --- /dev/null +++ b/wrappers/new-dlls/uianimation/uianimation_reg.idl @@ -0,0 +1,57 @@ +/* + * UiAnimation register. + * + * Copyright (C) 2018 Louis Lenders + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + uuid(bfcd4a0c-06b6-4384-b768-0daa792c380e), + threading(both) +] +coclass UIAnimationTimer +{ + [default] interface IUIAnimationTimer; +} + +[ + uuid(4c1fc63a-695c-47e8-a339-1a194be3d0b8), + threading(both) +] +coclass UIAnimationManager +{ + [default] interface IUIAnimationManager; +} + +[ + uuid(8a9b1cdd-fcd7-419c-8b44-42fd17db1887), + threading(both) +] +coclass UIAnimationTransitionFactory +{ + [default] interface IUIAnimationTransitionFactory; +} + +[ + uuid(1d6322ad-aa85-4ef5-a828-86d71067d145), + threading(both) +] +coclass UIAnimationTransitionLibrary +{ + [default] interface IUIAnimationTransitionLibrary; +} diff --git a/wrappers/new-dlls/uianimation/uianimation_typelib.idl b/wrappers/new-dlls/uianimation/uianimation_typelib.idl new file mode 100644 index 00000000000..ea1d2830381 --- /dev/null +++ b/wrappers/new-dlls/uianimation/uianimation_typelib.idl @@ -0,0 +1,23 @@ +/* + * UiAnimation typelib. + * + * Copyright (C) 2019 Alistair Leslie-Hughes + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep typelib + +#include "uianimation.idl" diff --git a/wrappers/new-dlls/uiribbon/CMakeLists.txt b/wrappers/new-dlls/uiribbon/CMakeLists.txt new file mode 100644 index 00000000000..8c256a48397 --- /dev/null +++ b/wrappers/new-dlls/uiribbon/CMakeLists.txt @@ -0,0 +1,26 @@ + +add_definitions(-D__WINESRC__) +remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) +add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600) +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) +include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos/wine) +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/dxsdk) +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/psdk) +include_directories(${REACTOS_SOURCE_DIR}/wrappers/includes) + +spec2def(uiribbon.dll uiribbon.spec) +add_idl_headers(uiribbon_idlheader uiribbon_classes.idl) + +list(APPEND SOURCE + main.c + uiribbon.c + version.rc + ${CMAKE_CURRENT_BINARY_DIR}/uiribbon_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/uiribbon.def) + +add_library(uiribbon SHARED ${SOURCE}) +add_dependencies(uiribbon uiribbon_idlheader) +set_module_type(uiribbon win32dll) +target_link_libraries(uiribbon wine uuid) +add_importlibs(uiribbon ole32 kernel32 ntdll msvcrt) +add_cd_file(TARGET uiribbon DESTINATION reactos/system32 FOR all) diff --git a/wrappers/new-dlls/uiribbon/Makefile.in b/wrappers/new-dlls/uiribbon/Makefile.in deleted file mode 100644 index f41b4d4a55a..00000000000 --- a/wrappers/new-dlls/uiribbon/Makefile.in +++ /dev/null @@ -1,10 +0,0 @@ -MODULE = uiribbon.dll -IMPORTS = uuid ole32 - -EXTRADLLFLAGS = -mno-cygwin - -C_SRCS = \ - main.c \ - uiribbon.c - -IDL_SRCS = uiribbon_classes.idl diff --git a/wrappers/new-dlls/uiribbon/main.c b/wrappers/new-dlls/uiribbon/main.c index b7749ae4710..e06c786fd6a 100644 --- a/wrappers/new-dlls/uiribbon/main.c +++ b/wrappers/new-dlls/uiribbon/main.c @@ -39,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(uiribbon); +static HINSTANCE instance; + typedef struct { IClassFactory IClassFactory_iface; @@ -179,3 +181,30 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) *ppv = &(factory->IClassFactory_iface); return S_OK; } + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} \ No newline at end of file diff --git a/wrappers/new-dlls/uiribbon/version.rc b/wrappers/new-dlls/uiribbon/version.rc new file mode 100644 index 00000000000..6d241b33a58 --- /dev/null +++ b/wrappers/new-dlls/uiribbon/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Gijs Vermeulen + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Windows Ribbon Framework for One-Core-API Compatibility Layer" +#define WINE_FILENAME_STR "uiribbon.dll" +#define WINE_FILEVERSION 6,1,7260,0 +#define WINE_FILEVERSION_STR "6.1.7260.0" +#define WINE_PRODUCTVERSION 6,1,7260,0 +#define WINE_PRODUCTVERSION_STR "6.1.7260.0" + +#include "wine/wine_common_ver.rc" diff --git a/wrappers/new-dlls/wevtsvc/Makefile.in b/wrappers/new-dlls/wevtsvc/Makefile.in new file mode 100644 index 00000000000..3dcbb804a35 --- /dev/null +++ b/wrappers/new-dlls/wevtsvc/Makefile.in @@ -0,0 +1,7 @@ +MODULE = wevtsvc.dll +IMPORTS = rpcrt4 advapi32 + +EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + wevtsvc.c diff --git a/wrappers/new-dlls/wevtsvc/wevtsvc.c b/wrappers/new-dlls/wevtsvc/wevtsvc.c new file mode 100644 index 00000000000..14c30791ff6 --- /dev/null +++ b/wrappers/new-dlls/wevtsvc/wevtsvc.c @@ -0,0 +1,87 @@ +/* + * Event Log Service + * + * Copyright 2020 Dmitry Timoshkov + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winsvc.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(eventlog); + +static SERVICE_STATUS_HANDLE svc_handle; +static HANDLE done_event; + +static void eventlog_update_status(DWORD state) +{ + SERVICE_STATUS status; + + status.dwServiceType = SERVICE_WIN32; + status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + status.dwWin32ExitCode = 0; + status.dwServiceSpecificExitCode = 0; + status.dwCheckPoint = 0; + status.dwWaitHint = 0; + status.dwControlsAccepted = 0; + status.dwCurrentState = state; + + SetServiceStatus(svc_handle, &status); +} + +static void WINAPI eventlog_handler(DWORD control) +{ + TRACE("%#x\n", control); + + switch (control) + { + case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_SHUTDOWN: + eventlog_update_status(SERVICE_STOP_PENDING); + SetEvent(done_event); + break; + + default: + eventlog_update_status(SERVICE_RUNNING); + break; + } +} + +void WINAPI ServiceMain(DWORD argc, LPWSTR *argv) +{ + TRACE("starting Event Log Service\n"); + + svc_handle = RegisterServiceCtrlHandlerW(L"EventLog", eventlog_handler); + if (!svc_handle) + { + ERR("RegisterServiceCtrlHandler error %u\n", GetLastError()); + return; + } + + eventlog_update_status(SERVICE_RUNNING); + + done_event = CreateEventW(NULL, TRUE, FALSE, NULL); + WaitForSingleObject(done_event, INFINITE); + CloseHandle(done_event); + + eventlog_update_status(SERVICE_STOPPED); + + TRACE("exiting Event Log Service\n"); +} diff --git a/wrappers/new-dlls/wevtsvc/wevtsvc.spec b/wrappers/new-dlls/wevtsvc/wevtsvc.spec new file mode 100644 index 00000000000..daa88578f7f --- /dev/null +++ b/wrappers/new-dlls/wevtsvc/wevtsvc.spec @@ -0,0 +1 @@ +@ stdcall -private ServiceMain(long ptr) diff --git a/wrappers/new-dlls/wpcap/Makefile.in b/wrappers/new-dlls/wpcap/Makefile.in new file mode 100644 index 00000000000..91b4a955911 --- /dev/null +++ b/wrappers/new-dlls/wpcap/Makefile.in @@ -0,0 +1,8 @@ +MODULE = wpcap.dll +DELAYIMPORTS = ws2_32 +EXTRALIBS = $(PCAP_LIBS) + +C_SRCS = \ + wpcap.c + +RC_SRCS = version.rc diff --git a/wrappers/new-dlls/wpcap/version.rc b/wrappers/new-dlls/wpcap/version.rc new file mode 100644 index 00000000000..d60cec46a58 --- /dev/null +++ b/wrappers/new-dlls/wpcap/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2014 André Hentschel + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "wpcap.dll Dynamic Link Library - based on libpcap 1.0" +#define WINE_FILENAME_STR "wpcap.dll" +#define WINE_FILEVERSION 4,1,0,2980 +#define WINE_FILEVERSION_STR "4.1.0.2980" +#define WINE_PRODUCTVERSION 4,1,0,2980 +#define WINE_PRODUCTVERSION_STR "4.1.0.2980" + +#include "wine/wine_common_ver.rc" diff --git a/wrappers/new-dlls/wpcap/wpcap.c b/wrappers/new-dlls/wpcap/wpcap.c new file mode 100644 index 00000000000..d2f1be7a312 --- /dev/null +++ b/wrappers/new-dlls/wpcap/wpcap.c @@ -0,0 +1,400 @@ +/* + * WPcap.dll Proxy. + * + * Copyright 2011, 2014 André Hentschel + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +/* pcap.h might define those: */ +#undef SOCKET +#undef INVALID_SOCKET + +#define USE_WS_PREFIX +#include "winsock2.h" +#include "windef.h" +#include "winbase.h" +#include "wine/heap.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wpcap); +WINE_DECLARE_DEBUG_CHANNEL(winediag); + +#ifndef PCAP_SRC_FILE_STRING +#define PCAP_SRC_FILE_STRING "file://" +#endif +#ifndef PCAP_SRC_FILE +#define PCAP_SRC_FILE 2 +#endif +#ifndef PCAP_SRC_IF_STRING +#define PCAP_SRC_IF_STRING "rpcap://" +#endif +#ifndef PCAP_SRC_IFLOCAL +#define PCAP_SRC_IFLOCAL 3 +#endif + +static inline WCHAR *heap_strdupAtoW(const char *str) +{ + LPWSTR ret = NULL; + + if(str) { + DWORD len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = heap_alloc(len*sizeof(WCHAR)); + if(ret) + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + } + + return ret; +} + +void CDECL wine_pcap_breakloop(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_breakloop(p); +} + +void CDECL wine_pcap_close(pcap_t *p) +{ + TRACE("(%p)\n", p); + pcap_close(p); +} + +int CDECL wine_pcap_compile(pcap_t *p, struct bpf_program *program, const char *buf, int optimize, + unsigned int mask) +{ + TRACE("(%p %p %s %i %u)\n", p, program, debugstr_a(buf), optimize, mask); + return pcap_compile(p, program, buf, optimize, mask); +} + +int CDECL wine_pcap_datalink(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_datalink(p); +} + +int CDECL wine_pcap_datalink_name_to_val(const char *name) +{ + TRACE("(%s)\n", debugstr_a(name)); + return pcap_datalink_name_to_val(name); +} + +const char* CDECL wine_pcap_datalink_val_to_description(int dlt) +{ + TRACE("(%i)\n", dlt); + return pcap_datalink_val_to_description(dlt); +} + +const char* CDECL wine_pcap_datalink_val_to_name(int dlt) +{ + TRACE("(%i)\n", dlt); + return pcap_datalink_val_to_name(dlt); +} + +typedef struct +{ + void (CALLBACK *pfn_cb)(u_char *, const struct pcap_pkthdr *, const u_char *); + void *user_data; +} PCAP_HANDLER_CALLBACK; + +static void pcap_handler_callback(u_char *user_data, const struct pcap_pkthdr *h, const u_char *p) +{ + PCAP_HANDLER_CALLBACK *pcb; + TRACE("(%p %p %p)\n", user_data, h, p); + pcb = (PCAP_HANDLER_CALLBACK *)user_data; + pcb->pfn_cb(pcb->user_data, h, p); + TRACE("Callback COMPLETED\n"); +} + +int CDECL wine_pcap_dispatch(pcap_t *p, int cnt, + void (CALLBACK *callback)(u_char *, const struct pcap_pkthdr *, const u_char *), + unsigned char *user) +{ + TRACE("(%p %i %p %p)\n", p, cnt, callback, user); + + if (callback) + { + PCAP_HANDLER_CALLBACK pcb; + pcb.pfn_cb = callback; + pcb.user_data = user; + return pcap_dispatch(p, cnt, pcap_handler_callback, (unsigned char *)&pcb); + } + + return pcap_dispatch(p, cnt, NULL, user); +} + +int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf) +{ + int ret; + + TRACE("(%p %p)\n", alldevsp, errbuf); + ret = pcap_findalldevs(alldevsp, errbuf); + if(alldevsp && !*alldevsp) + ERR_(winediag)("Failed to access raw network (pcap), this requires special permissions.\n"); + + return ret; +} + +int CDECL wine_pcap_findalldevs_ex(char *source, void *auth, pcap_if_t **alldevs, char *errbuf) +{ + FIXME("(%s %p %p %p): partial stub\n", debugstr_a(source), auth, alldevs, errbuf); + return wine_pcap_findalldevs(alldevs, errbuf); +} + +void CDECL wine_pcap_freealldevs(pcap_if_t *alldevs) +{ + TRACE("(%p)\n", alldevs); + pcap_freealldevs(alldevs); +} + +void CDECL wine_pcap_freecode(struct bpf_program *fp) +{ + TRACE("(%p)\n", fp); + return pcap_freecode(fp); +} + +typedef struct _AirpcapHandle *PAirpcapHandle; +PAirpcapHandle CDECL wine_pcap_get_airpcap_handle(pcap_t *p) +{ + TRACE("(%p)\n", p); + return NULL; +} + +char* CDECL wine_pcap_geterr(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_geterr(p); +} + +int CDECL wine_pcap_getnonblock(pcap_t *p, char *errbuf) +{ + TRACE("(%p %p)\n", p, errbuf); + return pcap_getnonblock(p, errbuf); +} + +const char* CDECL wine_pcap_lib_version(void) +{ + const char* ret = pcap_lib_version(); + TRACE("%s\n", debugstr_a(ret)); + return ret; +} + +int CDECL wine_pcap_list_datalinks(pcap_t *p, int **dlt_buffer) +{ + TRACE("(%p %p)\n", p, dlt_buffer); + return pcap_list_datalinks(p, dlt_buffer); +} + +char* CDECL wine_pcap_lookupdev(char *errbuf) +{ + static char *ret; + pcap_if_t *devs; + + TRACE("(%p)\n", errbuf); + if (!ret) + { + if (pcap_findalldevs( &devs, errbuf ) == -1) return NULL; + if (!devs) return NULL; + if ((ret = heap_alloc( strlen(devs->name) + 1 ))) strcpy( ret, devs->name ); + pcap_freealldevs( devs ); + } + return ret; +} + +int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned int *maskp, + char *errbuf) +{ + TRACE("(%s %p %p %p)\n", debugstr_a(device), netp, maskp, errbuf); + return pcap_lookupnet(device, netp, maskp, errbuf); +} + +int CDECL wine_pcap_loop(pcap_t *p, int cnt, + void (CALLBACK *callback)(u_char *, const struct pcap_pkthdr *, const u_char *), + unsigned char *user) +{ + TRACE("(%p %i %p %p)\n", p, cnt, callback, user); + + if (callback) + { + PCAP_HANDLER_CALLBACK pcb; + pcb.pfn_cb = callback; + pcb.user_data = user; + return pcap_loop(p, cnt, pcap_handler_callback, (unsigned char *)&pcb); + } + + return pcap_loop(p, cnt, NULL, user); +} + +int CDECL wine_pcap_major_version(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_major_version(p); +} + +int CDECL wine_pcap_minor_version(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_minor_version(p); +} + +const unsigned char* CDECL wine_pcap_next(pcap_t *p, struct pcap_pkthdr *h) +{ + TRACE("(%p %p)\n", p, h); + return pcap_next(p, h); +} + +int CDECL wine_pcap_next_ex(pcap_t *p, struct pcap_pkthdr **pkt_header, const unsigned char **pkt_data) +{ + TRACE("(%p %p %p)\n", p, pkt_header, pkt_data); + return pcap_next_ex(p, pkt_header, pkt_data); +} + +#ifndef PCAP_OPENFLAG_PROMISCUOUS +#define PCAP_OPENFLAG_PROMISCUOUS 1 +#endif + +pcap_t* CDECL wine_pcap_open(const char *source, int snaplen, int flags, int read_timeout, + void *auth, char *errbuf) +{ + int promisc = flags & PCAP_OPENFLAG_PROMISCUOUS; + FIXME("(%s %i %i %i %p %p): partial stub\n", debugstr_a(source), snaplen, flags, read_timeout, + auth, errbuf); + return pcap_open_live(source, snaplen, promisc, read_timeout, errbuf); +} + +pcap_t* CDECL wine_pcap_open_live(const char *source, int snaplen, int promisc, int to_ms, + char *errbuf) +{ + TRACE("(%s %i %i %i %p)\n", debugstr_a(source), snaplen, promisc, to_ms, errbuf); + return pcap_open_live(source, snaplen, promisc, to_ms, errbuf); +} + +int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf) +{ + int t = PCAP_SRC_IFLOCAL; + const char *p = source; + + FIXME("(%s %p %p %p %p %p): partial stub\n", debugstr_a(source), type, host, port, name, errbuf); + + if (host) + *host = '\0'; + if (port) + *port = '\0'; + if (name) + *name = '\0'; + + if (!strncmp(p, PCAP_SRC_IF_STRING, strlen(PCAP_SRC_IF_STRING))) + p += strlen(PCAP_SRC_IF_STRING); + else if (!strncmp(p, PCAP_SRC_FILE_STRING, strlen(PCAP_SRC_FILE_STRING))) + { + p += strlen(PCAP_SRC_FILE_STRING); + t = PCAP_SRC_FILE; + } + + if (type) + *type = t; + + if (!*p) + { + if (errbuf) + sprintf(errbuf, "The name has not been specified in the source string."); + return -1; + } + + if (name) + strcpy(name, p); + + return 0; +} + +int CDECL wine_pcap_sendpacket(pcap_t *p, const unsigned char *buf, int size) +{ + TRACE("(%p %p %i)\n", p, buf, size); + return pcap_sendpacket(p, buf, size); +} + +int CDECL wine_pcap_set_datalink(pcap_t *p, int dlt) +{ + TRACE("(%p %i)\n", p, dlt); + return pcap_set_datalink(p, dlt); +} + +int CDECL wine_pcap_setbuff(pcap_t * p, int dim) +{ + FIXME("(%p %i) stub\n", p, dim); + return 0; +} + +int CDECL wine_pcap_setfilter(pcap_t *p, struct bpf_program *fp) +{ + TRACE("(%p %p)\n", p, fp); + return pcap_setfilter(p, fp); +} + +int CDECL wine_pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf) +{ + TRACE("(%p %i %p)\n", p, nonblock, errbuf); + return pcap_setnonblock(p, nonblock, errbuf); +} + +int CDECL wine_pcap_snapshot(pcap_t *p) +{ + TRACE("(%p)\n", p); + return pcap_snapshot(p); +} + +int CDECL wine_pcap_stats(pcap_t *p, struct pcap_stat *ps) +{ + TRACE("(%p %p)\n", p, ps); + return pcap_stats(p, ps); +} + +int CDECL wine_wsockinit(void) +{ + WSADATA wsadata; + TRACE("()\n"); + if (WSAStartup(MAKEWORD(1,1), &wsadata)) return -1; + return 0; +} + +pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname) +{ + pcap_dumper_t *dumper; + WCHAR *fnameW = heap_strdupAtoW(fname); + char *unix_path; + + TRACE("(%p %s)\n", p, debugstr_a(fname)); + + unix_path = wine_get_unix_file_name(fnameW); + heap_free(fnameW); + if(!unix_path) + return NULL; + + TRACE("unix_path %s\n", debugstr_a(unix_path)); + + dumper = pcap_dump_open(p, unix_path); + heap_free(unix_path); + + return dumper; +} + +void CDECL wine_pcap_dump(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) +{ + TRACE("(%p %p %p)\n", user, h, sp); + return pcap_dump(user, h, sp); +} diff --git a/wrappers/new-dlls/wpcap/wpcap.spec b/wrappers/new-dlls/wpcap/wpcap.spec new file mode 100644 index 00000000000..ffb6ed1e551 --- /dev/null +++ b/wrappers/new-dlls/wpcap/wpcap.spec @@ -0,0 +1,78 @@ +@ stub bpf_dump +@ stub bpf_filter +@ stub bpf_image +@ stub bpf_validate +@ stub endservent +@ stub eproto_db +@ stub getservent +@ stub install_bpf_program +@ cdecl pcap_breakloop(ptr) wine_pcap_breakloop +@ cdecl pcap_close(ptr) wine_pcap_close +@ cdecl pcap_compile(ptr ptr str long long) wine_pcap_compile +@ stub pcap_compile_nopcap +@ stub pcap_createsrcstr +@ cdecl pcap_datalink(ptr) wine_pcap_datalink +@ cdecl pcap_datalink_name_to_val(str) wine_pcap_datalink_name_to_val +@ cdecl pcap_datalink_val_to_description(long) wine_pcap_datalink_val_to_description +@ cdecl pcap_datalink_val_to_name(long) wine_pcap_datalink_val_to_name +@ cdecl pcap_dispatch(ptr long ptr ptr) wine_pcap_dispatch +@ cdecl pcap_dump(ptr ptr str) wine_pcap_dump +@ stub pcap_dump_close +@ stub pcap_dump_file +@ stub pcap_dump_flush +@ stub pcap_dump_ftell +@ cdecl pcap_dump_open(ptr str) wine_pcap_dump_open +@ stub pcap_file +@ stub pcap_fileno +@ cdecl pcap_findalldevs(ptr ptr) wine_pcap_findalldevs +@ cdecl pcap_findalldevs_ex(ptr ptr ptr ptr) wine_pcap_findalldevs_ex +@ cdecl pcap_freealldevs(ptr) wine_pcap_freealldevs +@ cdecl pcap_freecode(ptr) wine_pcap_freecode +@ cdecl pcap_get_airpcap_handle(ptr) wine_pcap_get_airpcap_handle +@ cdecl pcap_geterr(ptr) wine_pcap_geterr +@ stub pcap_getevent +@ cdecl pcap_getnonblock(ptr ptr) wine_pcap_getnonblock +@ stub pcap_is_swapped +@ cdecl pcap_lib_version() wine_pcap_lib_version +@ cdecl pcap_list_datalinks(ptr ptr) wine_pcap_list_datalinks +@ stub pcap_live_dump +@ stub pcap_live_dump_ended +@ cdecl pcap_lookupdev(ptr) wine_pcap_lookupdev +@ cdecl pcap_lookupnet(str ptr ptr ptr) wine_pcap_lookupnet +@ cdecl pcap_loop(ptr long ptr ptr) wine_pcap_loop +@ cdecl pcap_major_version(ptr) wine_pcap_major_version +@ cdecl pcap_minor_version(ptr) wine_pcap_minor_version +@ cdecl pcap_next(ptr ptr) wine_pcap_next +@ stub pcap_next_etherent +@ cdecl pcap_next_ex(ptr ptr ptr) wine_pcap_next_ex +@ stub pcap_offline_filter +@ stub pcap_offline_read +@ cdecl pcap_open(str long long long ptr ptr) wine_pcap_open +@ stub pcap_open_dead +@ cdecl pcap_open_live(str long long long ptr) wine_pcap_open_live +@ stub pcap_open_offline +@ cdecl pcap_parsesrcstr(str ptr ptr ptr ptr ptr) wine_pcap_parsesrcstr +@ stub pcap_perror +@ stub pcap_read +@ stub pcap_remoteact_accept +@ stub pcap_remoteact_cleanup +@ stub pcap_remoteact_close +@ stub pcap_remoteact_list +@ cdecl pcap_sendpacket(ptr ptr long) wine_pcap_sendpacket +@ stub pcap_sendqueue_alloc +@ stub pcap_sendqueue_destroy +@ stub pcap_sendqueue_queue +@ stub pcap_sendqueue_transmit +@ cdecl pcap_set_datalink(ptr long) wine_pcap_set_datalink +@ cdecl pcap_setbuff(ptr long) wine_pcap_setbuff +@ cdecl pcap_setfilter(ptr ptr) wine_pcap_setfilter +@ stub pcap_setmintocopy +@ stub pcap_setmode +@ cdecl pcap_setnonblock(ptr long ptr) wine_pcap_setnonblock +@ stub pcap_setsampling +@ stub pcap_setuserbuffer +@ cdecl pcap_snapshot(ptr) wine_pcap_snapshot +@ cdecl pcap_stats(ptr ptr) wine_pcap_stats +@ stub pcap_stats_ex +@ cdecl pcap_strerror(long) msvcrt.strerror +@ cdecl wsockinit() wine_wsockinit diff --git a/wrappers/sdk/include/wsdk/CMakeLists.txt b/wrappers/sdk/include/wsdk/CMakeLists.txt new file mode 100644 index 00000000000..bbaaa084bd7 --- /dev/null +++ b/wrappers/sdk/include/wsdk/CMakeLists.txt @@ -0,0 +1,39 @@ + +add_definitions(-D_MIDL_USE_GUIDDEF_) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +list(APPEND SOURCE + activation.idl + d3d10.idl + d3d10_1.idl + d3d10sdklayers.idl + d3d11sdklayers.idl + d3d11.idl + dxgi.idl + dxgicommon.idl + dxgiformat.idl + dxgitype.idl + dxva2api.idl + evr.idl + evr9.idl + gameux.idl + hstring.idl + inspectable.idl + irpcss.idl + mfmediaengine.idl + mfplay.idl + mfreadwrite.idl + orpc.idl + restrictederrorinfo.idl + roparameterizediid.idl + rtworkq.idl + schrpc.idl + uiautomationclient.idl + uiautomationcore.idl + uiribbon.idl + wpcapi.idl + ) + +add_idl_headers(wsdk ${SOURCE}) +add_dependencies(wsdk xdk) \ No newline at end of file diff --git a/wrappers/sdk/include/wsdk/activation.idl b/wrappers/sdk/include/wsdk/activation.idl new file mode 100644 index 00000000000..b86c9f6b6fc --- /dev/null +++ b/wrappers/sdk/include/wsdk/activation.idl @@ -0,0 +1,31 @@ +/* + * Copyright 2016 Michael Müller + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DO_NO_IMPORTS +import "inspectable.idl"; +#endif + +[ + object, + uuid(00000035-0000-0000-c000-000000000046), + pointer_default(unique) +] +interface IActivationFactory : IInspectable +{ + HRESULT ActivateInstance([out] IInspectable **instance); +} diff --git a/sdk/include/dxsdk/avrt.h b/wrappers/sdk/include/wsdk/avrt.h similarity index 100% rename from sdk/include/dxsdk/avrt.h rename to wrappers/sdk/include/wsdk/avrt.h diff --git a/wrappers/includes/comm_version.rc b/wrappers/sdk/include/wsdk/comm_version.rc similarity index 100% rename from wrappers/includes/comm_version.rc rename to wrappers/sdk/include/wsdk/comm_version.rc diff --git a/sdk/include/reactos/wine/d3d10.idl b/wrappers/sdk/include/wsdk/d3d10.idl similarity index 100% rename from sdk/include/reactos/wine/d3d10.idl rename to wrappers/sdk/include/wsdk/d3d10.idl diff --git a/sdk/include/reactos/wine/d3d10_1.idl b/wrappers/sdk/include/wsdk/d3d10_1.idl similarity index 100% rename from sdk/include/reactos/wine/d3d10_1.idl rename to wrappers/sdk/include/wsdk/d3d10_1.idl diff --git a/sdk/include/reactos/wine/d3d10_1shader.h b/wrappers/sdk/include/wsdk/d3d10_1shader.h similarity index 100% rename from sdk/include/reactos/wine/d3d10_1shader.h rename to wrappers/sdk/include/wsdk/d3d10_1shader.h diff --git a/sdk/include/reactos/wine/d3d10sdklayers.idl b/wrappers/sdk/include/wsdk/d3d10sdklayers.idl similarity index 100% rename from sdk/include/reactos/wine/d3d10sdklayers.idl rename to wrappers/sdk/include/wsdk/d3d10sdklayers.idl diff --git a/sdk/include/reactos/wine/d3d10shader.h b/wrappers/sdk/include/wsdk/d3d10shader.h similarity index 100% rename from sdk/include/reactos/wine/d3d10shader.h rename to wrappers/sdk/include/wsdk/d3d10shader.h diff --git a/sdk/include/reactos/wine/d3d11.idl b/wrappers/sdk/include/wsdk/d3d11.idl similarity index 100% rename from sdk/include/reactos/wine/d3d11.idl rename to wrappers/sdk/include/wsdk/d3d11.idl diff --git a/sdk/include/reactos/wine/d3d11sdklayers.idl b/wrappers/sdk/include/wsdk/d3d11sdklayers.idl similarity index 100% rename from sdk/include/reactos/wine/d3d11sdklayers.idl rename to wrappers/sdk/include/wsdk/d3d11sdklayers.idl diff --git a/sdk/include/reactos/wine/dxgi.idl b/wrappers/sdk/include/wsdk/dxgi.idl similarity index 100% rename from sdk/include/reactos/wine/dxgi.idl rename to wrappers/sdk/include/wsdk/dxgi.idl diff --git a/sdk/include/reactos/wine/dxgicommon.idl b/wrappers/sdk/include/wsdk/dxgicommon.idl similarity index 100% rename from sdk/include/reactos/wine/dxgicommon.idl rename to wrappers/sdk/include/wsdk/dxgicommon.idl diff --git a/sdk/include/reactos/wine/dxgiformat.idl b/wrappers/sdk/include/wsdk/dxgiformat.idl similarity index 100% rename from sdk/include/reactos/wine/dxgiformat.idl rename to wrappers/sdk/include/wsdk/dxgiformat.idl diff --git a/sdk/include/reactos/wine/dxgitype.idl b/wrappers/sdk/include/wsdk/dxgitype.idl similarity index 100% rename from sdk/include/reactos/wine/dxgitype.idl rename to wrappers/sdk/include/wsdk/dxgitype.idl diff --git a/wrappers/includes/dxva2api.idl b/wrappers/sdk/include/wsdk/dxva2api.idl similarity index 100% rename from wrappers/includes/dxva2api.idl rename to wrappers/sdk/include/wsdk/dxva2api.idl diff --git a/sdk/include/reactos/wine/evr.idl b/wrappers/sdk/include/wsdk/evr.idl similarity index 100% rename from sdk/include/reactos/wine/evr.idl rename to wrappers/sdk/include/wsdk/evr.idl diff --git a/wrappers/includes/evr9.idl b/wrappers/sdk/include/wsdk/evr9.idl similarity index 100% rename from wrappers/includes/evr9.idl rename to wrappers/sdk/include/wsdk/evr9.idl diff --git a/wrappers/sdk/include/wsdk/gameux.idl b/wrappers/sdk/include/wsdk/gameux.idl new file mode 100644 index 00000000000..31be9ca29c5 --- /dev/null +++ b/wrappers/sdk/include/wsdk/gameux.idl @@ -0,0 +1,201 @@ + /* + * Defines the COM interfaces of Game Explorer + * + * Copyright (C) 2008 Alistair Leslie-Hughes + * Copyright (C) 2010 Mariusz Pluciński + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; +import "ocidl.idl"; +import "shobjidl.idl"; + +#ifndef __WIDL__ +#define threading(model) +#define progid(str) +#define vi_progid(str) +#endif + +[ + uuid(4F48A59C-942D-4F3C-83C9-4EFFE84E4959), + version(1.0), + helpstring("gameux public 1.0 Type Library") +] +library gameuxLib +{ + importlib("stdole2.tlb"); + + cpp_quote("#define ID_GDF_XML __GDF_XML") + cpp_quote("#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL") + cpp_quote("#define ID_ICON_ICO __ICON_ICO") + + cpp_quote("#if defined(__GNUC__)") + cpp_quote("#define ID_GDF_XML_STR (const WCHAR[]){'_','_','G','D','F','_','X','M','L',0}") + cpp_quote("#define ID_GDF_THUMBNAIL_STR (const WCHAR[]){'_','_','G','D','F','_','T','H','U','M','B','N','A','I','L',0}") + cpp_quote("#elif defined(_MSC_VER)") + cpp_quote("#define ID_GDF_XML_STR L\"__GDF_XML\"") + cpp_quote("#define ID_GDF_THUMBNAIL_STR L\"__GDF_THUMBNAIL\"") + cpp_quote("#endif") + + typedef enum + { + GIS_NOT_INSTALLED = 1, + GIS_CURRENT_USER = 2, + GIS_ALL_USERS = 3 + } GAME_INSTALL_SCOPE; + + typedef enum + { + GAMESTATS_OPEN_OPENORCREATE = 0, + GAMESTATS_OPEN_OPENONLY = 1 + } GAMESTATS_OPEN_TYPE; + + typedef enum + { + GAMESTATS_OPEN_CREATED = 0, + GAMESTATS_OPEN_OPENED = 1 + } GAMESTATS_OPEN_RESULT; + + [ + object, + uuid(E7B2FB72-D728-49B3-A5F2-18EBF5F1349E) + ] + interface IGameExplorer : IUnknown + { + HRESULT AddGame([in] BSTR sGDFBinaryPath, + [in] BSTR sInstallDirectory, + [in] GAME_INSTALL_SCOPE installScope, + [in, out] GUID* pguidInstanceID); + + HRESULT RemoveGame([in] GUID instanceID); + + HRESULT UpdateGame([in] GUID instanceID); + + HRESULT VerifyAccess([in] BSTR sGDFBinaryPath, + [out] BOOL* pHasAccess); + }; + + [ + object, + uuid(3887C9CA-04A0-42ae-BC4C-5FA6C7721145) + ] + interface IGameStatistics : IUnknown + { + HRESULT GetMaxCategoryLength( + [retval, out] UINT* cch); + + HRESULT GetMaxNameLength( + [retval, out] UINT* cch); + + HRESULT GetMaxValueLength( + [retval, out] UINT* cch); + + HRESULT GetMaxCategories( + [retval, out] WORD* pMax); + + HRESULT GetMaxStatsPerCategory( + [retval, out] WORD* pMax); + + HRESULT SetCategoryTitle( + [in] WORD categoryIndex, + [string, in] LPCWSTR title); + + HRESULT GetCategoryTitle( + [in] WORD categoryIndex, + [retval, string, out] LPWSTR* pTitle); + + HRESULT GetStatistic( + [in] WORD categoryIndex, + [in] WORD statIndex, + [string, unique, out, in] LPWSTR* pName, + [string, unique, out, in] LPWSTR* pValue); + + HRESULT SetStatistic( + [in] WORD categoryIndex, + [in] WORD statIndex, + [string, in] LPCWSTR name, + [string, in] LPCWSTR value); + + HRESULT Save( + [in] BOOL trackChanges); + + HRESULT SetLastPlayedCategory( + [in] UINT categoryIndex); + + HRESULT GetLastPlayedCategory( + [retval, out] UINT* pCategoryIndex); + }; + + [ + object, + uuid(AFF3EA11-E70E-407d-95DD-35E612C41CE2) + ] + interface IGameStatisticsMgr : IUnknown + { + HRESULT GetGameStatistics( + [string, in] LPCWSTR GDFBinaryPath, + [in] GAMESTATS_OPEN_TYPE openType, + [out] GAMESTATS_OPEN_RESULT* pOpenResult, + [retval, out] IGameStatistics** ppiStats); + + HRESULT RemoveGameStatistics( + [string, in] LPCWSTR GDFBinaryPath); + }; + + [ + object, + uuid(86874AA7-A1ED-450d-A7EB-B89E20B2FFF3) + ] + interface IGameExplorer2 : IUnknown + { + HRESULT InstallGame( + [string, in] LPCWSTR binaryGDFPath, + [unique, in] LPCWSTR installDirectory, + [in] GAME_INSTALL_SCOPE installScope); + + HRESULT UninstallGame( + [string, in] LPCWSTR binaryGDFPath); + + HRESULT CheckAccess( + [string, in] LPCWSTR binaryGDFPath, + [retval, out] BOOL* pHasAccess); + + } + + [ + helpstring("GameExplorer Class"), + threading(both), + progid("gameux.GameExplorer.1"), + vi_progid("gameux.GameExplorer"), + uuid(9A5EA990-3034-4D6F-9128-01F3C61022BC) + ] + coclass GameExplorer + { + [default] interface IGameExplorer; + }; + + [ + helpstring("GameStatistics Class"), + threading(apartment), + progid("gameux.GameStatistics.1"), + vi_progid("gameux.GameStatistics"), + uuid(DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4) + ] + coclass GameStatistics + { + [default] interface IGameStatistics; + }; +} diff --git a/wrappers/sdk/include/wsdk/hstring.idl b/wrappers/sdk/include/wsdk/hstring.idl new file mode 100644 index 00000000000..2623f34dcb5 --- /dev/null +++ b/wrappers/sdk/include/wsdk/hstring.idl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 Martin Storsjo + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "wtypes.idl"; + +typedef struct HSTRING__ +{ + int unused; +} HSTRING__; + +typedef [wire_marshal(wireBSTR), unique] HSTRING__* HSTRING; + +cpp_quote("DECLARE_HANDLE(HSTRING_BUFFER);") + +cpp_quote("typedef struct HSTRING_HEADER") +cpp_quote("{") +cpp_quote(" union") +cpp_quote(" {") +cpp_quote(" PVOID Reserved1;") +cpp_quote("#ifdef _WIN64") +cpp_quote(" char Reserved2[24];") +cpp_quote("#else") +cpp_quote(" char Reserved2[20];") +cpp_quote("#endif") +cpp_quote(" } Reserved;") +cpp_quote("} HSTRING_HEADER;") diff --git a/wrappers/sdk/include/wsdk/inspectable.idl b/wrappers/sdk/include/wsdk/inspectable.idl new file mode 100644 index 00000000000..847d21da608 --- /dev/null +++ b/wrappers/sdk/include/wsdk/inspectable.idl @@ -0,0 +1,41 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "wtypes.idl"; +import "unknwn.idl"; +import "hstring.idl"; + +typedef [v1_enum] enum TrustLevel { + BaseTrust, + PartialTrust, + FullTrust +} TrustLevel; + +[ + object, + uuid(af86e2e0-b12d-4c6a-9c5a-d7aa65101e90), + pointer_default(unique) +] +interface IInspectable : IUnknown +{ + HRESULT GetIids([out] ULONG *iidCount, [out, size_is(,*iidCount)] IID **iids); + HRESULT GetRuntimeClassName([out] HSTRING *className); + HRESULT GetTrustLevel([out] TrustLevel *trustLevel); +} + +typedef [unique] IInspectable *LPINSPECTABLE; diff --git a/sdk/include/reactos/wine/irpcss.idl b/wrappers/sdk/include/wsdk/irpcss.idl similarity index 100% rename from sdk/include/reactos/wine/irpcss.idl rename to wrappers/sdk/include/wsdk/irpcss.idl diff --git a/sdk/include/dxsdk/mfapi.h b/wrappers/sdk/include/wsdk/mfapi.h similarity index 100% rename from sdk/include/dxsdk/mfapi.h rename to wrappers/sdk/include/wsdk/mfapi.h diff --git a/sdk/include/dxsdk/mferror.h b/wrappers/sdk/include/wsdk/mferror.h similarity index 100% rename from sdk/include/dxsdk/mferror.h rename to wrappers/sdk/include/wsdk/mferror.h diff --git a/sdk/include/reactos/wine/mfmediaengine.idl b/wrappers/sdk/include/wsdk/mfmediaengine.idl similarity index 100% rename from sdk/include/reactos/wine/mfmediaengine.idl rename to wrappers/sdk/include/wsdk/mfmediaengine.idl diff --git a/sdk/include/reactos/wine/mfplay.idl b/wrappers/sdk/include/wsdk/mfplay.idl similarity index 100% rename from sdk/include/reactos/wine/mfplay.idl rename to wrappers/sdk/include/wsdk/mfplay.idl diff --git a/sdk/include/reactos/wine/mfreadwrite.idl b/wrappers/sdk/include/wsdk/mfreadwrite.idl similarity index 100% rename from sdk/include/reactos/wine/mfreadwrite.idl rename to wrappers/sdk/include/wsdk/mfreadwrite.idl diff --git a/wrappers/includes/msvcrt/corecrt.h b/wrappers/sdk/include/wsdk/msvcrt/corecrt.h similarity index 100% rename from wrappers/includes/msvcrt/corecrt.h rename to wrappers/sdk/include/wsdk/msvcrt/corecrt.h diff --git a/wrappers/includes/msvcrt/limits.h b/wrappers/sdk/include/wsdk/msvcrt/limits.h similarity index 100% rename from wrappers/includes/msvcrt/limits.h rename to wrappers/sdk/include/wsdk/msvcrt/limits.h diff --git a/wrappers/includes/ntdllbase.h b/wrappers/sdk/include/wsdk/ntdllbase.h similarity index 100% rename from wrappers/includes/ntdllbase.h rename to wrappers/sdk/include/wsdk/ntdllbase.h diff --git a/sdk/include/reactos/wine/orpc.idl b/wrappers/sdk/include/wsdk/orpc.idl similarity index 100% rename from sdk/include/reactos/wine/orpc.idl rename to wrappers/sdk/include/wsdk/orpc.idl diff --git a/sdk/include/psdk/restartmanager.h b/wrappers/sdk/include/wsdk/restartmanager.h similarity index 100% rename from sdk/include/psdk/restartmanager.h rename to wrappers/sdk/include/wsdk/restartmanager.h diff --git a/wrappers/sdk/include/wsdk/restrictederrorinfo.idl b/wrappers/sdk/include/wsdk/restrictederrorinfo.idl new file mode 100644 index 00000000000..e444256a041 --- /dev/null +++ b/wrappers/sdk/include/wsdk/restrictederrorinfo.idl @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Louis Lenders + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; + +[ + object, + uuid(82ba7092-4c88-427d-a7bc-16dd93feb67e), + pointer_default(unique) +] +interface IRestrictedErrorInfo : IUnknown +{ + HRESULT GetErrorDetails ( + [out] BSTR *desc, + [out] HRESULT *error, + [out] BSTR *restricted_desc, + [out] BSTR *sid); + + HRESULT GetReference ([out] BSTR *reference); +} diff --git a/sdk/include/reactos/wine/roapi.h b/wrappers/sdk/include/wsdk/roapi.h similarity index 100% rename from sdk/include/reactos/wine/roapi.h rename to wrappers/sdk/include/wsdk/roapi.h diff --git a/sdk/include/psdk/roerrorapi.h b/wrappers/sdk/include/wsdk/roerrorapi.h similarity index 100% rename from sdk/include/psdk/roerrorapi.h rename to wrappers/sdk/include/wsdk/roerrorapi.h diff --git a/wrappers/sdk/include/wsdk/roparameterizediid.idl b/wrappers/sdk/include/wsdk/roparameterizediid.idl new file mode 100644 index 00000000000..85ee57d6f94 --- /dev/null +++ b/wrappers/sdk/include/wsdk/roparameterizediid.idl @@ -0,0 +1,95 @@ +/* + * Copyright 2017 Alex Henrie + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt +#endif + +import "wtypes.idl"; + +typedef void *ROPARAMIIDHANDLE; + +[ + object +] +interface IRoSimpleMetaDataBuilder +{ + HRESULT SetWinRtInterface( + GUID iid + ); + + HRESULT SetDelegate( + GUID iid + ); + + HRESULT SetInterfaceGroupSimpleDefault( + const WCHAR *typename, + const WCHAR *default_name, + const GUID *default_iid + ); + + HRESULT SetInterfaceGroupParameterizedDefault( + const WCHAR *typename, + UINT32 name_element_count, + const WCHAR **name_elements + ); + + HRESULT SetRuntimeClassSimpleDefault( + const WCHAR *typename, + const WCHAR *default_name, + const GUID *default_iid + ); + + HRESULT SetRuntimeClassParameterizedDefault( + const WCHAR *typename, + UINT32 name_element_count, + const WCHAR **name_elements + ); + + HRESULT SetStruct( + const WCHAR *typename, + UINT32 field_count, + const WCHAR **field_typenames + ); + + HRESULT SetEnum( + const WCHAR *typename, + const WCHAR *base_type + ); + + HRESULT SetParameterizedInterface( + GUID iid, + UINT32 arg_count + ); + + HRESULT SetParameterizedDelegate( + GUID iid, + UINT32 arg_count + ); +} + +[ + object +] +interface IRoMetaDataLocator +{ + HRESULT Locate( + const WCHAR *typename, + IRoSimpleMetaDataBuilder *out + ); +} diff --git a/sdk/include/reactos/wine/rtworkq.idl b/wrappers/sdk/include/wsdk/rtworkq.idl similarity index 100% rename from sdk/include/reactos/wine/rtworkq.idl rename to wrappers/sdk/include/wsdk/rtworkq.idl diff --git a/sdk/include/reactos/wine/schrpc.idl b/wrappers/sdk/include/wsdk/schrpc.idl similarity index 100% rename from sdk/include/reactos/wine/schrpc.idl rename to wrappers/sdk/include/wsdk/schrpc.idl diff --git a/sdk/include/psdk/shellscalingapi.h b/wrappers/sdk/include/wsdk/shellscalingapi.h similarity index 100% rename from sdk/include/psdk/shellscalingapi.h rename to wrappers/sdk/include/wsdk/shellscalingapi.h diff --git a/sdk/include/reactos/wine/strmbase.h b/wrappers/sdk/include/wsdk/strmbase.h similarity index 100% rename from sdk/include/reactos/wine/strmbase.h rename to wrappers/sdk/include/wsdk/strmbase.h diff --git a/wrappers/includes/threadpool.h b/wrappers/sdk/include/wsdk/threadpool.h similarity index 100% rename from wrappers/includes/threadpool.h rename to wrappers/sdk/include/wsdk/threadpool.h diff --git a/wrappers/includes/threadpoolapiset.h b/wrappers/sdk/include/wsdk/threadpoolapiset.h similarity index 100% rename from wrappers/includes/threadpoolapiset.h rename to wrappers/sdk/include/wsdk/threadpoolapiset.h diff --git a/wrappers/sdk/include/wsdk/uiautomationclient.idl b/wrappers/sdk/include/wsdk/uiautomationclient.idl new file mode 100644 index 00000000000..ca768ba6d07 --- /dev/null +++ b/wrappers/sdk/include/wsdk/uiautomationclient.idl @@ -0,0 +1,149 @@ +/* + * Copyright 2012 Jacek Caban for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define DO_NO_IMPORTS +import "uiautomationcore.idl"; + +[ + uuid(944de083-8fb8-45cf-bcb7-c477acb2f897), + lcid(0), + version(1.0) +] +library UIAutomationClient { + importlib ("stdole2.tlb"); + + /* FIXME: Uncomment when properly supported in widl + [dllname("")] + module UIA_PropertyIds + { + */ + const long UIA_RuntimeIdPropertyId = 30000; + const long UIA_BoundingRectanglePropertyId = 30001; + const long UIA_ProcessIdPropertyId = 30002; + const long UIA_ControlTypePropertyId = 30003; + const long UIA_LocalizedControlTypePropertyId = 30004; + const long UIA_NamePropertyId = 30005; + const long UIA_AcceleratorKeyPropertyId = 30006; + const long UIA_AccessKeyPropertyId = 30007; + const long UIA_HasKeyboardFocusPropertyId = 30008; + const long UIA_IsKeyboardFocusablePropertyId = 30009; + const long UIA_IsEnabledPropertyId = 30010; + const long UIA_AutomationIdPropertyId = 30011; + const long UIA_ClassNamePropertyId = 30012; + const long UIA_HelpTextPropertyId = 30013; + const long UIA_ClickablePointPropertyId = 30014; + const long UIA_CulturePropertyId = 30015; + const long UIA_IsControlElementPropertyId = 30016; + const long UIA_IsContentElementPropertyId = 30017; + const long UIA_LabeledByPropertyId = 30018; + const long UIA_IsPasswordPropertyId = 30019; + const long UIA_NativeWindowHandlePropertyId = 30020; + const long UIA_ItemTypePropertyId = 30021; + const long UIA_IsOffscreenPropertyId = 30022; + const long UIA_OrientationPropertyId = 30023; + const long UIA_FrameworkIdPropertyId = 30024; + const long UIA_IsRequiredForFormPropertyId = 30025; + const long UIA_ItemStatusPropertyId = 30026; + const long UIA_IsDockPatternAvailablePropertyId = 30027; + const long UIA_IsExpandCollapsePatternAvailablePropertyId = 30028; + const long UIA_IsGridItemPatternAvailablePropertyId = 30029; + const long UIA_IsGridPatternAvailablePropertyId = 30030; + const long UIA_IsInvokePatternAvailablePropertyId = 30031; + const long UIA_IsMultipleViewPatternAvailablePropertyId = 30032; + const long UIA_IsRangeValuePatternAvailablePropertyId = 30033; + const long UIA_IsScrollPatternAvailablePropertyId = 30034; + const long UIA_IsScrollItemPatternAvailablePropertyId = 30035; + const long UIA_IsSelectionItemPatternAvailablePropertyId = 30036; + const long UIA_IsSelectionPatternAvailablePropertyId = 30037; + const long UIA_IsTablePatternAvailablePropertyId = 30038; + const long UIA_IsTableItemPatternAvailablePropertyId = 30039; + const long UIA_IsTextPatternAvailablePropertyId = 30040; + const long UIA_IsTogglePatternAvailablePropertyId = 30041; + const long UIA_IsTransformPatternAvailablePropertyId = 30042; + const long UIA_IsValuePatternAvailablePropertyId = 30043; + const long UIA_IsWindowPatternAvailablePropertyId = 30044; + const long UIA_ValueValuePropertyId = 30045; + const long UIA_ValueIsReadOnlyPropertyId = 30046; + const long UIA_RangeValueValuePropertyId = 30047; + const long UIA_RangeValueIsReadOnlyPropertyId = 30048; + const long UIA_RangeValueMinimumPropertyId = 30049; + const long UIA_RangeValueMaximumPropertyId = 30050; + const long UIA_RangeValueLargeChangePropertyId = 30051; + const long UIA_RangeValueSmallChangePropertyId = 30052; + const long UIA_ScrollHorizontalScrollPercentPropertyId = 30053; + const long UIA_ScrollHorizontalViewSizePropertyId = 30054; + const long UIA_ScrollVerticalScrollPercentPropertyId = 30055; + const long UIA_ScrollVerticalViewSizePropertyId = 30056; + const long UIA_ScrollHorizontallyScrollablePropertyId = 30057; + const long UIA_ScrollVerticallyScrollablePropertyId = 30058; + const long UIA_SelectionSelectionPropertyId = 30059; + const long UIA_SelectionCanSelectMultiplePropertyId = 30060; + const long UIA_SelectionIsSelectionRequiredPropertyId = 30061; + const long UIA_GridRowCountPropertyId = 30062; + const long UIA_GridColumnCountPropertyId = 30063; + const long UIA_GridItemRowPropertyId = 30064; + const long UIA_GridItemColumnPropertyId = 30065; + const long UIA_GridItemRowSpanPropertyId = 30066; + const long UIA_GridItemColumnSpanPropertyId = 30067; + const long UIA_GridItemContainingGridPropertyId = 30068; + const long UIA_DockDockPositionPropertyId = 30069; + const long UIA_ExpandCollapseExpandCollapseStatePropertyId = 30070; + const long UIA_MultipleViewCurrentViewPropertyId = 30071; + const long UIA_MultipleViewSupportedViewsPropertyId = 30072; + const long UIA_WindowCanMaximizePropertyId = 30073; + const long UIA_WindowCanMinimizePropertyId = 30074; + const long UIA_WindowWindowVisualStatePropertyId = 30075; + const long UIA_WindowWindowInteractionStatePropertyId = 30076; + const long UIA_WindowIsModalPropertyId = 30077; + const long UIA_WindowIsTopmostPropertyId = 30078; + const long UIA_SelectionItemIsSelectedPropertyId = 30079; + const long UIA_SelectionItemSelectionContainerPropertyId = 30080; + const long UIA_TableRowHeadersPropertyId = 30081; + const long UIA_TableColumnHeadersPropertyId = 30082; + const long UIA_TableRowOrColumnMajorPropertyId = 30083; + const long UIA_TableItemRowHeaderItemsPropertyId = 30084; + const long UIA_TableItemColumnHeaderItemsPropertyId = 30085; + const long UIA_ToggleToggleStatePropertyId = 30086; + const long UIA_TransformCanMovePropertyId = 30087; + const long UIA_TransformCanResizePropertyId = 30088; + const long UIA_TransformCanRotatePropertyId = 30089; + const long UIA_IsLegacyIAccessiblePatternAvailablePropertyId = 30090; + const long UIA_LegacyIAccessibleChildIdPropertyId = 30091; + const long UIA_LegacyIAccessibleNamePropertyId = 30092; + const long UIA_LegacyIAccessibleValuePropertyId = 30093; + const long UIA_LegacyIAccessibleDescriptionPropertyId = 30094; + const long UIA_LegacyIAccessibleRolePropertyId = 30095; + const long UIA_LegacyIAccessibleStatePropertyId = 30096; + const long UIA_LegacyIAccessibleHelpPropertyId = 30097; + const long UIA_LegacyIAccessibleKeyboardShortcutPropertyId = 30098; + const long UIA_LegacyIAccessibleSelectionPropertyId = 30099; + const long UIA_LegacyIAccessibleDefaultActionPropertyId = 30100; + const long UIA_AriaRolePropertyId = 30101; + const long UIA_AriaPropertiesPropertyId = 30102; + const long UIA_IsDataValidForFormPropertyId = 30103; + const long UIA_ControllerForPropertyId = 30104; + const long UIA_DescribedByPropertyId = 30105; + const long UIA_FlowsToPropertyId = 30106; + const long UIA_ProviderDescriptionPropertyId = 30107; + const long UIA_IsItemContainerPatternAvailablePropertyId = 30108; + const long UIA_IsVirtualizedItemPatternAvailablePropertyId = 30109; + const long UIA_IsSynchronizedInputPatternAvailablePropertyId = 30110; + /* + } + */ +} diff --git a/wrappers/sdk/include/wsdk/uiautomationcore.idl b/wrappers/sdk/include/wsdk/uiautomationcore.idl new file mode 100644 index 00000000000..3ae6dac4b3f --- /dev/null +++ b/wrappers/sdk/include/wsdk/uiautomationcore.idl @@ -0,0 +1,91 @@ +/* + * Copyright 2012 Jacek Caban for CodeWeavers + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define DO_NO_IMPORTS +import "oaidl.idl"; +import "oleacc.idl"; + +enum ProviderOptions { + ProviderOptions_ClientSideProvider = 0x0001, + ProviderOptions_ServerSideProvider = 0x0002, + ProviderOptions_NonClientAreaProvider = 0x0004, + ProviderOptions_OverrideProvider = 0x0008, + ProviderOptions_ProviderOwnsSetFocus = 0x0010, + ProviderOptions_UseComThreading = 0x0020 +}; + +typedef int PROPERTYID; +typedef int PATTERNID; +typedef int EVENTID; +typedef int TEXTATTRIBUTEID; +typedef int CONTROLTYPEID; + +[ + version(1.0), + uuid(930299ce-9965-4dec-b0f4-a54848d4b667), + lcid(0), + hidden +] +library UIA +{ + importlib("stdole2.tlb"); + + [ + object, + uuid(d6dd68d1-86fd-4332-8666-9abedea2d24c), + pointer_default(unique) + ] + interface IRawElementProviderSimple : IUnknown + { + [propget] HRESULT ProviderOptions([out, retval] enum ProviderOptions *pRetVal); + + HRESULT GetPatternProvider( + [in] PATTERNID patternId, + [out, retval] IUnknown **pRetVal); + + HRESULT GetPropertyValue( + [in] PROPERTYID propertyId, + [out, retval] VARIANT *pRetVal); + + [propget] HRESULT HostRawElementProvider([out, retval] IRawElementProviderSimple **pRetVal); + } + + [ + object, + uuid(f8b80ada-2c44-48d0-89be-5ff23c9cd875), + pointer_default(unique), + oleautomation + ] + interface IAccessibleEx : IUnknown + { + HRESULT GetObjectForChild( + [in] long idChild, + [out, retval] IAccessibleEx **pRetVal); + + HRESULT GetIAccessiblePair( + [out] IAccessible **ppAcc, + [out] long *pidChild); + + HRESULT GetRuntimeId( + [out, retval] SAFEARRAY(int) *pRetVal); + + HRESULT ConvertReturnedElement( + [in] IRawElementProviderSimple *pIn, + [out] IAccessibleEx **ppRetValOut); + } +} diff --git a/sdk/include/psdk/uiautomationcoreapi.h b/wrappers/sdk/include/wsdk/uiautomationcoreapi.h similarity index 100% rename from sdk/include/psdk/uiautomationcoreapi.h rename to wrappers/sdk/include/wsdk/uiautomationcoreapi.h diff --git a/wrappers/sdk/include/wsdk/uiribbon.idl b/wrappers/sdk/include/wsdk/uiribbon.idl new file mode 100644 index 00000000000..d67e5cdbd5c --- /dev/null +++ b/wrappers/sdk/include/wsdk/uiribbon.idl @@ -0,0 +1,310 @@ +/* + * COM Classes for uiribbon + * + * Copyright 2017 Fabian Maurer + * + * 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.1 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "propsys.idl"; + +#ifndef __WIDL__ +#define threading(model) +#endif + +typedef enum UI_INVALIDATIONS { + UI_INVALIDATIONS_STATE = 0x00000001, + UI_INVALIDATIONS_VALUE = 0x00000002, + UI_INVALIDATIONS_PROPERTY = 0x00000004, + UI_INVALIDATIONS_ALLPROPERTIES = 0x00000008, +} UI_INVALIDATIONS; + +typedef enum UI_EXECUTIONVERB { + UI_EXECUTIONVERB_EXECUTE, + UI_EXECUTIONVERB_PREVIEW, + UI_EXECUTIONVERB_CANCELPREVIEW, +} UI_EXECUTIONVERB; + +typedef enum UI_VIEWTYPE { + UI_VIEWTYPE_RIBBON = 1 +} UI_VIEWTYPE; + +typedef enum UI_VIEWVERB { + UI_VIEWVERB_CREATE, + UI_VIEWVERB_DESTROY, + UI_VIEWVERB_SIZE, + UI_VIEWVERB_ERROR, +} UI_VIEWVERB; + +typedef enum UI_COMMANDTYPE { + UI_COMMANDTYPE_UNKNOWN, + UI_COMMANDTYPE_GROUP, + UI_COMMANDTYPE_ACTION, + UI_COMMANDTYPE_ANCHOR, + UI_COMMANDTYPE_CONTEXT, + UI_COMMANDTYPE_COLLECTION, + UI_COMMANDTYPE_COMMANDCOLLECTION, + UI_COMMANDTYPE_DECIMAL, + UI_COMMANDTYPE_BOOLEAN, + UI_COMMANDTYPE_FONT, + UI_COMMANDTYPE_RECENTITEMS, + UI_COMMANDTYPE_COLORANCHOR, + UI_COMMANDTYPE_COLORCOLLECTION, +} UI_COMMANDTYPE; + +typedef [v1_enum] enum UI_OWNERSHIP { + UI_OWNERSHIP_TRANSFER = 0, + UI_OWNERSHIP_COPY = 1, +} UI_OWNERSHIP; + +typedef [v1_enum] enum UI_COLLECTIONCHANGE { + UI_COLLECTIONCHANGE_INSERT = 0, + UI_COLLECTIONCHANGE_REMOVE = 1, + UI_COLLECTIONCHANGE_REPLACE = 2, + UI_COLLECTIONCHANGE_RESET = 3 +} UI_COLLECTIONCHANGE; + +[ + object, + uuid(c205bb48-5b1c-4219-a106-15bd0a5f24e2), + local, + pointer_default(unique) +] +interface IUISimplePropertySet : IUnknown +{ + HRESULT GetValue( + [in] REFPROPERTYKEY key, + [out] PROPVARIANT *value + ); +} + +[ + object, + uuid(75ae0a2d-dc03-4c9f-8883-069660d0beb6), + local, + pointer_default(unique) +] +interface IUICommandHandler : IUnknown +{ + HRESULT Execute( + [in] UINT32 commandId, + [in] UI_EXECUTIONVERB verb, + [in] const PROPERTYKEY *key, + [in] const PROPVARIANT *currentValue, + [in] IUISimplePropertySet *commandExecutionProperties + ); + HRESULT UpdateProperty( + [in] UINT32 commandId, + [in] REFPROPERTYKEY key, + [in] const PROPVARIANT *currentValue, + [out] PROPVARIANT *newValue + ); +} + +[ + object, + uuid(d428903c-729a-491d-910d-682a08ff2522), + local, + pointer_default(unique) +] +interface IUIApplication : IUnknown +{ + HRESULT OnViewChanged( + [in] UINT32 viewId, + [in] UI_VIEWTYPE typeID, + [in] IUnknown *view, + [in] UI_VIEWVERB verb, + [in] INT32 uReasonCode + ); + HRESULT OnCreateUICommand( + [in] UINT32 commandId, + [in] UI_COMMANDTYPE typeID, + [out] IUICommandHandler **commandHandler + ); + HRESULT OnDestroyUICommand( + [in] UINT32 commandId, + [in] UI_COMMANDTYPE typeID, + [in] IUICommandHandler *commandHandler + ); +} + +[ + object, + uuid(f4f0385d-6872-43a8-ad09-4c339cb3f5c5), + local, + pointer_default(unique) +] +interface IUIFramework : IUnknown +{ + HRESULT Initialize( + [in] HWND frameWnd, + [in] IUIApplication *application + ); + HRESULT Destroy( + ); + HRESULT LoadUI( + [in] HINSTANCE instance, + [in] LPCWSTR resourceName + ); + HRESULT GetView( + [in] UINT32 viewId, + [in] REFIID riid, + [out] void **ppv + ); + HRESULT GetUICommandProperty( + [in] UINT32 commandId, + [in] REFPROPERTYKEY key, + [out] PROPVARIANT *value + ); + HRESULT SetUICommandProperty( + [in] UINT32 commandId, + [in] REFPROPERTYKEY key, + [in] PROPVARIANT value + ); + HRESULT InvalidateUICommand( + [in] UINT32 commandId, + [in] UI_INVALIDATIONS flags, + [in] const PROPERTYKEY *key + ); + HRESULT FlushPendingInvalidations( + ); + HRESULT SetModes( + INT32 iModes + ); +} + +[ + object, + uuid(23c8c838-4de6-436b-ab01-5554bb7c30dd), + local, + pointer_default(unique) +] +interface IUIImage : IUnknown +{ + HRESULT GetBitmap( + [out] HBITMAP *bitmap + ); +} + +[ + object, + uuid(803982ab-370a-4f7e-a9e7-8784036a6e26), + local, + pointer_default(unique) +] +interface IUIRibbon : IUnknown +{ + HRESULT GetHeight( + [out] UINT32 *cy + ); + HRESULT LoadSettingsFromStream( + [in] IStream *pStream + ); + HRESULT SaveSettingsToStream( + [in] IStream *pStream + ); +} + +[ + object, + uuid(df4f45bf-6f9d-4dd7-9d68-d8f9cd18c4db), + local, + pointer_default(unique) +] +interface IUICollection : IUnknown +{ + HRESULT GetCount( + [out] UINT32 *count + ); + HRESULT GetItem( + [in] UINT32 index, + [out] IUnknown **item + ); + HRESULT Add( + [in] IUnknown *item + ); + HRESULT Insert( + [in] UINT32 index, + [in] IUnknown *item + ); + HRESULT RemoveAt( + [in] UINT32 index + ); + HRESULT Replace( + [in] UINT32 indexReplaced, + [in] IUnknown *itemReplaceWith + ); + HRESULT Clear(); +} + +[ + object, + uuid(eea11f37-7c46-437c-8e55-b52122b29293), + local, + pointer_default(unique) +] +interface IUIContextualUI : IUnknown +{ + HRESULT ShowAtLocation( + [in] INT32 x, + [in] INT32 y + ); +} + +[ + object, + uuid(6502ae91-a14d-44b5-bbd0-62aacc581d52), + local, + pointer_default(unique) +] +interface IUICollectionChangedEvent : IUnknown +{ + HRESULT OnChanged( + [in] UI_COLLECTIONCHANGE action, + [in] UINT32 oldIndex, + [in] IUnknown *oldItem, + [in] UINT32 newIndex, + [in] IUnknown *newItem + ); +} + +[ + object, + uuid(18aba7f3-4c1c-4ba2-bf6c-f5c3326fa816), + local, + pointer_default(unique) +] +interface IUIImageFromBitmap : IUnknown +{ + HRESULT CreateImage( + [in] HBITMAP bitmap, + [in] UI_OWNERSHIP options, + [out] IUIImage **image + ); +} + + +[ + helpstring("UIRibbonFramework Object"), + threading(apartment), + uuid(926749fa-2615-4987-8845-c33e65f2b957) +] +coclass UIRibbonFramework { interface IUIFramework; } + +[ + threading(apartment), + uuid(0f7434b6-59b6-4250-999e-d168d6ae4293) +] +coclass UIRibbonImageFromBitmapFactory { interface IUIImageFromBitmap; } diff --git a/sdk/include/reactos/wine/winstring.h b/wrappers/sdk/include/wsdk/winstring.h similarity index 100% rename from sdk/include/reactos/wine/winstring.h rename to wrappers/sdk/include/wsdk/winstring.h diff --git a/wrappers/new-dlls/wpc/wpcapi.idl b/wrappers/sdk/include/wsdk/wpcapi.idl similarity index 100% rename from wrappers/new-dlls/wpc/wpcapi.idl rename to wrappers/sdk/include/wsdk/wpcapi.idl diff --git a/wrappers/lib/CMakeLists.txt b/wrappers/sdk/lib/CMakeLists.txt similarity index 100% rename from wrappers/lib/CMakeLists.txt rename to wrappers/sdk/lib/CMakeLists.txt diff --git a/wrappers/lib/mfuuid/CMakeLists.txt b/wrappers/sdk/lib/mfuuid/CMakeLists.txt similarity index 100% rename from wrappers/lib/mfuuid/CMakeLists.txt rename to wrappers/sdk/lib/mfuuid/CMakeLists.txt diff --git a/wrappers/lib/mfuuid/mfplay.c b/wrappers/sdk/lib/mfuuid/mfplay.c similarity index 100% rename from wrappers/lib/mfuuid/mfplay.c rename to wrappers/sdk/lib/mfuuid/mfplay.c diff --git a/wrappers/lib/mfuuid/mfuuid.c b/wrappers/sdk/lib/mfuuid/mfuuid.c similarity index 100% rename from wrappers/lib/mfuuid/mfuuid.c rename to wrappers/sdk/lib/mfuuid/mfuuid.c diff --git a/wrappers/to-synch/CMakeLists.txt b/wrappers/to-synch/CMakeLists.txt new file mode 100644 index 00000000000..ee35bd46346 --- /dev/null +++ b/wrappers/to-synch/CMakeLists.txt @@ -0,0 +1,285 @@ + +cmake_minimum_required(VERSION 3.2.1) +cmake_policy(VERSION 3.2.1) + +if(NOT CMAKE_VERSION MATCHES "ReactOS") + message(WARNING "Building with \"${CMAKE_COMMAND}\", which is not the custom CMake included in RosBE, might cause build issues...") +endif() + +if(POLICY CMP0058) + # Ninja requires custom command byproducts to be explicit + cmake_policy(SET CMP0058 OLD) +endif() + +if(POLICY CMP0065) + # Do not add flags to export symbols from executables without the ENABLE_EXPORTS target property + cmake_policy(SET CMP0065 NEW) +endif() + +include(CMakeDependentOption) + +project(REACTOS) + +# Versioning +include(sdk/include/reactos/version.cmake) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) +set(CMAKE_SHARED_LIBRARY_PREFIX "") +set(CMAKE_SHARED_MODULE_PREFIX "") +set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE) +set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE) +set(CMAKE_COLOR_MAKEFILE OFF) +set(CMAKE_POSITION_INDEPENDENT_CODE OFF) +#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) + +if(NOT ARCH) + set(ARCH i386) +endif() +# Now the ARCH variable will be in lowercase. +# It is needed because STREQUAL comparison +# is case-sensitive. +# See http://cmake.3232098.n2.nabble.com/Case-insensitive-string-compare-td7580269.html +# for more information. +string(TOLOWER ${ARCH} ARCH) + +# Compile options +if(ARCH STREQUAL "i386") + include(sdk/cmake/config.cmake) +elseif(ARCH STREQUAL "amd64") + include(sdk/cmake/config-amd64.cmake) +elseif(ARCH STREQUAL "arm") + include(sdk/cmake/config-arm.cmake) +endif() + +# Compiler flags handling +include(sdk/cmake/compilerflags.cmake) + +add_definitions(-D__REACTOS__) + +# Double escape, since CMake unescapes before putting it on the command-line, where it's unescaped again by GCC/CL. +add_definitions(-DREACTOS_SOURCE_DIR="${REACTOS_SOURCE_DIR}") +add_definitions(-DREACTOS_BINARY_DIR="${REACTOS_BINARY_DIR}") + +# There doesn't seem to be a standard for __FILE__ being relative or absolute, so detect it at runtime. +file(RELATIVE_PATH _PATH_PREFIX ${REACTOS_BINARY_DIR} ${REACTOS_SOURCE_DIR}) +add_compile_flags(-D__RELFILE__="&__FILE__[__FILE__[0] == '.' ? sizeof \\\"${_PATH_PREFIX}\\\" - 1 : sizeof REACTOS_SOURCE_DIR]") + +if(MSVC_IDE) + add_compile_flags("/MP") +endif() + +# Bison and Flex support +# include(sdk/cmake/bison-flex.cmake) + +if(NOT CMAKE_CROSSCOMPILING) + set(TOOLS_FOLDER ${CMAKE_CURRENT_BINARY_DIR}) + add_definitions(-DTARGET_${ARCH}) + + if(MSVC) + if(ARCH STREQUAL "i386") + add_definitions(/D_X86_ /D__i386__ /DWIN32 /D_WINDOWS) + elseif(ARCH STREQUAL "amd64") + add_definitions(-D_AMD64_ -D__x86_64__ /DWIN32 -D_WINDOWS) + endif() + if(MSVC_VERSION GREATER 1699) + add_definitions(/D_ALLOW_KEYWORD_MACROS) + endif() + if(NOT USE_CLANG_CL) + # FIXME: Inspect + add_definitions(/Dinline=__inline) + endif() + endif() + add_subdirectory(sdk/include/host) + + if(NOT MSVC) + add_subdirectory(dll/win32/dbghelp) + endif() + add_subdirectory(sdk/tools) + add_subdirectory(sdk/lib) + + set(NATIVE_TARGETS bin2c widl gendib cabman fatten hpp isohybrid mkhive mkisofs obj2bin spec2def geninc mkshelllink utf16le xml2sdb) + if(NOT MSVC) + list(APPEND NATIVE_TARGETS rsym pefixup) + endif() + + export(TARGETS ${NATIVE_TARGETS} FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) + configure_file(sdk/cmake/host-tools.in ${CMAKE_BINARY_DIR}/TargetList.cmake) + +else() + # Add host tools target + include(sdk/cmake/host-tools.cmake) + setup_host_tools() + + # We don't need CMake importlib handling. + unset(CMAKE_IMPORT_LIBRARY_SUFFIX) + + # Print build type + message("-- Build Type: ${CMAKE_BUILD_TYPE}") + + # adjust the default behaviour of the FIND_XXX() commands: + # search headers and libraries in the target environment, search + # programs in the host environment + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + + #useful stuff! + include(CMakeParseArguments) + + if(DBG) + add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE) + else() + add_definitions(-DDBG=0) + endif() + + if(KDBG) + add_definitions(-DKDBG) + endif() + + if(_WINKD_) + add_definitions(-D_WINKD_) + endif() + + if(CMAKE_VERSION MATCHES "ReactOS" AND CMAKE_VERSION VERSION_LESS 3.3.0) + set(PCH 1 CACHE BOOL "Whether to use precompiled headers") + else() + set(PCH 0 CACHE BOOL "Whether to use precompiled headers") + endif() + + # Version Options + add_definitions(-DWINVER=0x502 + -D_WIN32_IE=0x600 + -D_WIN32_WINNT=0x502 + -D_WIN32_WINDOWS=0x502 + -D_SETUPAPI_VER=0x502 + -DMINGW_HAS_SECURE_API=1) + + # Arch Options + if(ARCH STREQUAL "i386") + if(NOT USE_CLANG_CL) + add_definitions(-D_M_IX86) + endif() + add_definitions(-D_X86_ -D__i386__ -Di386) + if(SARCH STREQUAL "xbox") + add_definitions(-DSARCH_XBOX) + elseif(SARCH STREQUAL "pc98") + add_definitions(-DSARCH_PC98) + endif() + elseif(ARCH STREQUAL "amd64") + add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64) + elseif(ARCH STREQUAL "arm") + # _M_ARM is already defined by toolchain + add_definitions(-D_ARM_ -D__arm__ -DWIN32) + if(SARCH STREQUAL "omap-zoom2") + add_definitions(-D_ZOOM2_) + endif() + endif() + + # Other + add_definitions(-D_NEW_DELETE_OPERATORS_) + if(ARCH STREQUAL "i386") + add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T) + elseif(ARCH STREQUAL "amd64") + add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX) + elseif(ARCH STREQUAL "arm") + add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX) + endif() + + # Activate support for assembly source files + enable_language(ASM) + + # Activate language support for resource files + enable_language(RC) + + # Localization definitions + include(sdk/cmake/localization.cmake) + set(I18N_DEFS "") + # This will set I18N_DEFS for later use + set_i18n_language(${I18N_LANG}) + + # Compiler specific definitions and macros + if(MSVC) + include(sdk/cmake/msvc.cmake) + else() + include(sdk/cmake/gcc.cmake) + endif() + + # Generic macros + include(sdk/cmake/CMakeMacros.cmake) + + # IDL macros for widl/midl + # We're using widl now for both MSVC and GCC builds + include(sdk/cmake/widl-support.cmake) + + include_directories( + sdk/include + sdk/include/psdk + sdk/include/dxsdk + ${REACTOS_BINARY_DIR}/sdk/include + ${REACTOS_BINARY_DIR}/sdk/include/psdk + ${REACTOS_BINARY_DIR}/sdk/include/dxsdk + ${REACTOS_BINARY_DIR}/sdk/include/ddk + ${REACTOS_BINARY_DIR}/sdk/include/reactos + ${REACTOS_BINARY_DIR}/sdk/include/reactos/mc + ${REACTOS_BINARY_DIR}/wrappers/sdk/include + sdk/include/crt + sdk/include/ddk + sdk/include/ndk + sdk/include/reactos + sdk/include/reactos/libs) + + if(ARCH STREQUAL "arm") + include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/arm) + endif() + + add_dependency_header() + + add_subdirectory(sdk/include/ndk/tests) + add_subdirectory(sdk/include/xdk) + add_subdirectory(sdk/include/psdk) + add_subdirectory(sdk/include/dxsdk) + add_subdirectory(sdk/include/reactos/wine) + add_subdirectory(sdk/include/reactos/mc) + add_subdirectory(sdk/include/asm) + + if(NO_ROSSYM) + include(sdk/cmake/baseaddress_dwarf.cmake) + elseif(MSVC) + include(sdk/cmake/baseaddress_msvc.cmake) + else() + include(sdk/cmake/baseaddress.cmake) + endif() + + # For MSVC builds, this puts all debug symbols file in the same directory. + if (MSVC) + set(CMAKE_PDB_OUTPUT_DIRECTORY "${REACTOS_BINARY_DIR}/msvc_pdb") + elseif(SEPARATE_DBG) + set(CMAKE_PDB_OUTPUT_DIRECTORY "${REACTOS_BINARY_DIR}/symbols") + endif() + + #begin with boot so reactos_cab target is defined before all other modules + add_subdirectory(boot) + add_subdirectory(base) + add_subdirectory(dll) + add_subdirectory(drivers) + add_subdirectory(hal) + add_subdirectory(sdk/lib) + add_subdirectory(media) + add_subdirectory(modules) + add_subdirectory(ntoskrnl) + add_subdirectory(subsystems) + add_subdirectory(sdk/tools/wpp) + add_subdirectory(win32ss) + add_subdirectory(wrappers) + + # Create the registry hives + create_registry_hives() + + # Create {bootcd, livecd, bootcdregtest}.lst + create_iso_lists() + + file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/sdk/include/reactos) + + add_dependency_footer() +endif() diff --git a/wrappers/to-synch/sdk/include/dxsdk/avrt.h b/wrappers/to-synch/sdk/include/dxsdk/avrt.h deleted file mode 100644 index 88beebb0bf8..00000000000 --- a/wrappers/to-synch/sdk/include/dxsdk/avrt.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * avrt definitions - * - * Copyright 2009 Maarten Lankhorst - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#ifndef _AVRT_ -#define _AVRT_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum _AVRT_PRIORITY -{ - AVRT_PRIORITY_VERYLOW = -2, - AVRT_PRIORITY_LOW, - AVRT_PRIORITY_NORMAL, - AVRT_PRIORITY_HIGH, - AVRT_PRIORITY_CRITICAL -} AVRT_PRIORITY, *PAVRT_PRIORITY; - -/* Windows compiler is more lax */ -#define THREAD_ORDER_GROUP_INFINITE_TIMEOUT ((void*)((LONG_PTR)-1)) - -HANDLE WINAPI AvSetMmThreadCharacteristicsA(LPCSTR TaskName, LPDWORD TaskIndex); -HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex); -#define AvSetMmThreadCharacteristics WINELIB_NAME_AW(AvSetMmThreadCharacteristics) - -HANDLE WINAPI AvSetMmMaxThreadCharacteristicsA(LPCSTR FirstTask, LPCSTR SecondTask, LPDWORD TaskIndex); -HANDLE WINAPI AvSetMmMaxThreadCharacteristicsW(LPCWSTR FirstTask, LPCWSTR SecondTask, LPDWORD TaskIndex); -#define AvSetMmMaxThreadCharacteristics WINELIB_NAME_AW(AvSetMmMaxThreadCharacteristics) - -BOOL WINAPI AvRevertMmThreadCharacteristics(HANDLE AvrtHandle); -BOOL WINAPI AvSetMmThreadPriority(HANDLE AvrtHandle, AVRT_PRIORITY Priority); -BOOL WINAPI AvRtCreateThreadOrderingGroup( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout); - -BOOL WINAPI AvRtCreateThreadOrderingGroupExA( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout, - LPCSTR TaskName); -BOOL WINAPI AvRtCreateThreadOrderingGroupExW( - PHANDLE Context, PLARGE_INTEGER Period, - GUID *ThreadOrderingGuid, PLARGE_INTEGER Timeout, - LPCSTR TaskName); -#define AvRtCreateThreadOrderingGroupEx WINELIB_NAME_AW(AvRtCreateThreadOrderingGroupEx) - -BOOL WINAPI AvRtJoinThreadOrderingGroup(PHANDLE Context, GUID *ThreadOrderingGuid, BOOL Before); -BOOL WINAPI AvRtWaitOnThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvRtLeaveThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvRtDeleteThreadOrderingGroup(HANDLE Context); -BOOL WINAPI AvQuerySystemResponsiveness(HANDLE AvrtHandle, PULONG SystemResponsivenessValue); - -#ifdef __cplusplus -} -#endif - -#endif /*_AVRT_*/ diff --git a/wrappers/to-synch/sdk/include/dxsdk/mfapi.h b/wrappers/to-synch/sdk/include/dxsdk/mfapi.h deleted file mode 100644 index a3945bd3a7d..00000000000 --- a/wrappers/to-synch/sdk/include/dxsdk/mfapi.h +++ /dev/null @@ -1,599 +0,0 @@ -/* - * Copyright (C) 2015 Austin English - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_MFAPI_H -#define __WINE_MFAPI_H - -#include -#include -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !defined(MF_VERSION) -/* Default to Windows XP */ -#define MF_SDK_VERSION 0x0001 -#define MF_API_VERSION 0x0070 -#define MF_VERSION (MF_SDK_VERSION << 16 | MF_API_VERSION) -#endif - -#define MFSTARTUP_NOSOCKET 0x1 -#define MFSTARTUP_LITE (MFSTARTUP_NOSOCKET) -#define MFSTARTUP_FULL 0 - -#ifndef MAKEFOURCC -#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) -#endif - -#ifndef DEFINE_MEDIATYPE_GUID -#define DEFINE_MEDIATYPE_GUID(name, format) \ - DEFINE_GUID(name, format, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -#endif - -#ifndef DIRECT3D_VERSION -#define LOCAL_D3DFMT_DEFINES 1 -#define D3DFMT_R8G8B8 20 -#define D3DFMT_A8R8G8B8 21 -#define D3DFMT_X8R8G8B8 22 -#define D3DFMT_R5G6B5 23 -#define D3DFMT_X1R5G5B5 24 -#define D3DFMT_A2B10G10R10 31 -#define D3DFMT_P8 41 -#define D3DFMT_L8 50 -#define D3DFMT_D16 80 -#define D3DFMT_L16 81 -#define D3DFMT_A16B16G16R16F 113 -#endif - -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Base, 0); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB8, D3DFMT_P8); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB555, D3DFMT_X1R5G5B5); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB565, D3DFMT_R5G6B5); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB24, D3DFMT_R8G8B8); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB32, D3DFMT_X8R8G8B8); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB32, D3DFMT_A8R8G8B8); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_A2R10G10B10, D3DFMT_A2B10G10R10); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_A16B16G16R16F, D3DFMT_A16B16G16R16F); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_L8, D3DFMT_L8); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_L16, D3DFMT_L16); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_D16, D3DFMT_D16); - -DEFINE_MEDIATYPE_GUID(MFVideoFormat_420O, MAKEFOURCC('4','2','0','O')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVSL, MAKEFOURCC('d','v','s','l')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVSD, MAKEFOURCC('d','v','s','d')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVHD, MAKEFOURCC('d','v','h','d')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DV25, MAKEFOURCC('d','v','2','5')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DV50, MAKEFOURCC('d','v','5','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVH1, MAKEFOURCC('d','v','h','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVC, MAKEFOURCC('d','v','c',' ')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_v210, MAKEFOURCC('v','2','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_v216, MAKEFOURCC('v','2','1','6')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_v410, MAKEFOURCC('v','4','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_AI44, MAKEFOURCC('A','I','4','4')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_AV1, MAKEFOURCC('A','V','0','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_AYUV, MAKEFOURCC('A','Y','U','V')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_H263, MAKEFOURCC('H','2','6','3')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_H264, MAKEFOURCC('H','2','6','4')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_H265, MAKEFOURCC('H','2','6','5')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_HEVC, MAKEFOURCC('H','E','V','C')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_HEVC_ES, MAKEFOURCC('H','E','V','S')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_I420, MAKEFOURCC('I','4','2','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_IYUV, MAKEFOURCC('I','Y','U','V')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_M4S2, MAKEFOURCC('M','4','S','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MJPG, MAKEFOURCC('M','J','P','G')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP43, MAKEFOURCC('M','P','4','3')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP4S, MAKEFOURCC('M','P','4','S')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP4V, MAKEFOURCC('M','P','4','V')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MPG1, MAKEFOURCC('M','P','G','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS1, MAKEFOURCC('M','S','S','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS2, MAKEFOURCC('M','S','S','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV11, MAKEFOURCC('N','V','1','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV12, MAKEFOURCC('N','V','1','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_ORAW, MAKEFOURCC('O','R','A','W')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_P010, MAKEFOURCC('P','0','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_P016, MAKEFOURCC('P','0','1','6')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_P210, MAKEFOURCC('P','2','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_P216, MAKEFOURCC('P','2','1','6')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_UYVY, MAKEFOURCC('U','Y','V','Y')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP10, MAKEFOURCC('V','P','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP80, MAKEFOURCC('V','P','8','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP90, MAKEFOURCC('V','P','9','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y210, MAKEFOURCC('Y','2','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y216, MAKEFOURCC('Y','2','1','6')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y410, MAKEFOURCC('Y','4','1','0')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y416, MAKEFOURCC('Y','4','1','6')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y41P, MAKEFOURCC('Y','4','1','P')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y41T, MAKEFOURCC('Y','4','1','T')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y42T, MAKEFOURCC('Y','4','2','T')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_YUY2, MAKEFOURCC('Y','U','Y','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_YV12, MAKEFOURCC('Y','V','1','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_YVYU, MAKEFOURCC('Y','V','Y','U')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_YVU9, MAKEFOURCC('Y','V','U','9')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV1, MAKEFOURCC('W','M','V','1')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV2, MAKEFOURCC('W','M','V','2')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV3, MAKEFOURCC('W','M','V','3')); -DEFINE_MEDIATYPE_GUID(MFVideoFormat_WVC1, MAKEFOURCC('W','V','C','1')); - -DEFINE_GUID(MFVideoFormat_Base_HDCP, 0xeac3b9d5, 0xbd14, 0x4237, 0x8f, 0x1f, 0xba, 0xb4, 0x28, 0xe4, 0x93, 0x12); -DEFINE_GUID(MFVideoFormat_H264_ES, 0x3f40f4f0, 0x5622, 0x4ff8, 0xb6, 0xd8, 0xa1, 0x7a, 0x58, 0x4b, 0xee, 0x5e); -DEFINE_GUID(MFVideoFormat_H264_HDCP, 0x5d0ce9dd, 0x9817, 0x49da, 0xbd, 0xfd, 0xf5, 0xf5, 0xb9, 0x8f, 0x18, 0xa6); -DEFINE_GUID(MFVideoFormat_HEVC_HDCP, 0x3cfe0fe6, 0x05c4, 0x47dc, 0x9d, 0x70, 0x4b, 0xdb, 0x29, 0x59, 0x72, 0x0f); -DEFINE_GUID(MFVideoFormat_MPEG2, 0xe06d8026, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); - -#define MFVideoFormat_MPG2 MFVideoFormat_MPEG2 - -#ifdef LOCAL_D3DFMT_DEFINES -#undef D3DFMT_R8G8B8 -#undef D3DFMT_A8R8G8B8 -#undef D3DFMT_X8R8G8B8 -#undef D3DFMT_R5G6B5 -#undef D3DFMT_X1R5G5B5 -#undef D3DFMT_A2B10G10R10 -#undef D3DFMT_P8 -#undef D3DFMT_L8 -#undef D3DFMT_D16 -#undef D3DFMT_L16 -#undef D3DFMT_A16B16G16R16F -#undef LOCAL_D3DFMT_DEFINES -#endif - -DEFINE_MEDIATYPE_GUID(MFAudioFormat_Base, 0); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_AAC, WAVE_FORMAT_MPEG_HEAAC); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_ADTS, WAVE_FORMAT_MPEG_ADTS_AAC); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_ALAC, WAVE_FORMAT_ALAC); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_NB, WAVE_FORMAT_AMR_NB); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_WB, WAVE_FORMAT_AMR_WB); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_WP, WAVE_FORMAT_AMR_WP); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_Dolby_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_DRM, WAVE_FORMAT_DRM); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_DTS, WAVE_FORMAT_DTS); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_FLAC, WAVE_FORMAT_FLAC); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_MPEG, WAVE_FORMAT_MPEG); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_MSP1, WAVE_FORMAT_WMAVOICE9); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_Opus, WAVE_FORMAT_OPUS); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_PCM, WAVE_FORMAT_PCM); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudioV8, WAVE_FORMAT_WMAUDIO2); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudioV9, WAVE_FORMAT_WMAUDIO3); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudio_Lossless, WAVE_FORMAT_WMAUDIO_LOSSLESS); -DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMASPDIF, WAVE_FORMAT_WMASPDIF); - -DEFINE_GUID(MFAudioFormat_AAC_HDCP, 0x419bce76, 0x8b72, 0x400f, 0xad, 0xeb, 0x84, 0xb5, 0x7d, 0x63, 0x48, 0x4d); -DEFINE_GUID(MFAudioFormat_ADTS_HDCP, 0xda4963a3, 0x14d8, 0x4dcf, 0x92, 0xb7, 0x19, 0x3e, 0xb8, 0x43, 0x63, 0xdb); -DEFINE_GUID(MFAudioFormat_Base_HDCP, 0x3884b5bc, 0xe277, 0x43fd, 0x98, 0x3d, 0x03, 0x8a, 0xa8, 0xd9, 0xb6, 0x05); -DEFINE_GUID(MFAudioFormat_Dolby_AC3, 0xe06d802c, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(MFAudioFormat_Dolby_AC3_HDCP, 0x97663a80, 0x8ffb, 0x4445, 0xa6, 0xba, 0x79, 0x2d, 0x90, 0x8f, 0x49, 0x7f); -DEFINE_GUID(MFAudioFormat_Dolby_DDPlus, 0xa7fb87af, 0x2d02, 0x42fb, 0xa4, 0xd4, 0x05, 0xcd, 0x93, 0x84, 0x3b, 0xdd); -DEFINE_GUID(MFAudioFormat_Float_SpatialObjects, 0xfa39cd94, 0xbc64, 0x4ab1, 0x9b, 0x71, 0xdc, 0xd0, 0x9d, 0x5a, 0x7e, 0x7a); -DEFINE_GUID(MFAudioFormat_LPCM, 0xe06d8032, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(MFAudioFormat_PCM_HDCP, 0xa5e7ff01, 0x8411, 0x4acc, 0xa8, 0x65, 0x5f, 0x49, 0x41, 0x28, 0x8d, 0x80); -DEFINE_GUID(MFAudioFormat_Vorbis, 0x8d2fd10b, 0x5841, 0x4a6b, 0x89, 0x05, 0x58, 0x8f, 0xec, 0x1a, 0xde, 0xd9); - -DEFINE_GUID(MFImageFormat_JPEG, 0x19e4a5aa, 0x5662, 0x4fc5, 0xa0, 0xc0, 0x17, 0x58, 0x02, 0x8e, 0x10, 0x57); -DEFINE_GUID(MFImageFormat_RGB32, 0x00000016, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); - -DEFINE_GUID(MFStreamFormat_MPEG2Transport, 0xe06d8023, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(MFStreamFormat_MPEG2Program, 0x263067d1, 0xd330, 0x45dc, 0xb6, 0x69, 0x34, 0xd9, 0x86, 0xe4, 0xe3, 0xe1); - -DEFINE_GUID(AM_MEDIA_TYPE_REPRESENTATION, 0xe2e42ad2, 0x132c, 0x491e, 0xa2, 0x68, 0x3c, 0x7c, 0x2d, 0xca, 0x18, 0x1f); -DEFINE_GUID(FORMAT_MFVideoFormat, 0xaed4ab2d, 0x7326, 0x43cb, 0x94, 0x64, 0xc8, 0x79, 0xca, 0xb9, 0xc4, 0x3d); - -#if defined(__cplusplus) && !defined(CINTERFACE) -typedef struct tagMFASYNCRESULT : public IMFAsyncResult { -#else -typedef struct tagMFASYNCRESULT -{ - IMFAsyncResult AsyncResult; -#endif - OVERLAPPED overlapped; - IMFAsyncCallback *pCallback; - HRESULT hrStatusResult; - DWORD dwBytesTransferred; - HANDLE hEvent; -} MFASYNCRESULT; - -typedef enum _EAllocationType -{ - eAllocationTypeDynamic, - eAllocationTypeRT, - eAllocationTypePageable, - eAllocationTypeIgnore -} EAllocationType; - -#ifdef MF_INIT_GUIDS -#include -#endif - -DEFINE_GUID(MF_MT_AM_FORMAT_TYPE, 0x73d1072d, 0x1870, 0x4174, 0xa0, 0x63, 0x29, 0xff, 0x4f, 0xf6, 0xc1, 0x1e); -DEFINE_GUID(MF_MT_AVG_BIT_ERROR_RATE, 0x799cabd6, 0x3508, 0x4db4, 0xa3, 0xc7, 0x56, 0x9c, 0xd5, 0x33, 0xde, 0xb1); -DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); -DEFINE_GUID(MF_MT_CUSTOM_VIDEO_PRIMARIES, 0x47537213, 0x8cfb, 0x4722, 0xaa, 0x34, 0xfb, 0xc9, 0xe2, 0x4d, 0x77, 0xb8); -DEFINE_GUID(MF_MT_DECODER_MAX_DPB_COUNT, 0x67be144c, 0x88b7, 0x4ca9, 0x96, 0x28, 0xc8, 0x08, 0xd5, 0x26, 0x22, 0x17); -DEFINE_GUID(MF_MT_DECODER_USE_MAX_RESOLUTION, 0x4c547c24, 0xaf9a, 0x4f38, 0x96, 0xad, 0x97, 0x87, 0x73, 0xcf, 0x53, 0xe7); -DEFINE_GUID(MF_MT_DRM_FLAGS, 0x8772f323, 0x355a, 0x4cc7, 0xbb, 0x78, 0x6d, 0x61, 0xa0, 0x48, 0xae, 0x82); -DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); -DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); -DEFINE_GUID(MF_MT_GEOMETRIC_APERTURE, 0x66758743, 0x7e5f, 0x400d, 0x98, 0x0a, 0xaa, 0x85, 0x96, 0xc8, 0x56, 0x96); -DEFINE_GUID(MF_MT_IMAGE_LOSS_TOLERANT, 0xed062cf4, 0xe34e, 0x4922, 0xbe, 0x99, 0x93, 0x40, 0x32, 0x13, 0x3d, 0x7c); -DEFINE_GUID(MF_MT_INTERLACE_MODE, 0xe2724bb8, 0xe676, 0x4806, 0xb4, 0xb2, 0xa8, 0xd6, 0xef, 0xb4, 0x4c, 0xcd); -DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f); -DEFINE_GUID(MF_MT_MAX_FRAME_AVERAGE_LUMINANCE_LEVEL, 0x58d4bf57, 0x6f52, 0x4733, 0xa1, 0x95, 0xa9, 0xe2, 0x9e, 0xcf, 0x9e, 0x27); -DEFINE_GUID(MF_MT_MAX_KEYFRAME_SPACING, 0xc16eb52b, 0x73a1, 0x476f, 0x8d, 0x62, 0x83, 0x9d, 0x6a, 0x02, 0x06, 0x52); -DEFINE_GUID(MF_MT_MAX_LUMINANCE_LEVEL, 0x50253128, 0xc110, 0x4de4, 0x98, 0xae, 0x46, 0xa3, 0x24, 0xfa, 0xe6, 0xda); -DEFINE_GUID(MF_MT_MAX_MASTERING_LUMINANCE, 0xd6c6b997, 0x272f, 0x4ca1, 0x8d, 0x00, 0x80, 0x42, 0x11, 0x1a, 0x0f, 0xf6); -DEFINE_GUID(MF_MT_MIN_MASTERING_LUMINANCE, 0x839a4460, 0x4e7e, 0x4b4f, 0xae, 0x79, 0xcc, 0x08, 0x90, 0x5c, 0x7b, 0x27); -DEFINE_GUID(MF_MT_MINIMUM_DISPLAY_APERTURE, 0xd7388766, 0x18fe, 0x48c6, 0xa1, 0x77, 0xee, 0x89, 0x48, 0x67, 0xc8, 0xc4); -DEFINE_GUID(MF_MT_MPEG4_SAMPLE_DESCRIPTION, 0x261e9d83, 0x9529, 0x4b8f, 0xa1, 0x11, 0x8b, 0x9c, 0x95, 0x0a, 0x81, 0xa9); -DEFINE_GUID(MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY, 0x9aa7e155, 0xb64a, 0x4c1d, 0xa5, 0x00, 0x45, 0x5d, 0x60, 0x0b, 0x65, 0x60); -DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); -DEFINE_GUID(MF_MT_REALTIME_CONTENT, 0xbb12d222, 0x2bdb, 0x425e, 0x91, 0xec, 0x23, 0x08, 0xe1, 0x89, 0xa5, 0x8f); -DEFINE_GUID(MF_MT_OUTPUT_BUFFER_NUM, 0xa505d3ac, 0xf930, 0x436e, 0x8e, 0xde, 0x93, 0xa5, 0x09, 0xce, 0x23, 0xb2); -DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); -DEFINE_GUID(MF_MT_ALL_SAMPLES_INDEPENDENT, 0xc9173739, 0x5e56, 0x461c, 0xb7, 0x13, 0x46, 0xfb, 0x99, 0x5c, 0xb9, 0x5f); -DEFINE_GUID(MF_MT_USER_DATA, 0xb6bc765f, 0x4c3b, 0x40a4, 0xbd, 0x51, 0x25, 0x35, 0xb6, 0x6f, 0xe0, 0x9d); -DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MIN, 0xd2e7558c, 0xdc1f, 0x403f, 0x9a, 0x72, 0xd2, 0x8b, 0xb1, 0xeb, 0x3b, 0x5e); -DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MAX, 0xe3371d41, 0xb4cf, 0x4a05, 0xbd, 0x4e, 0x20, 0xb8, 0x8b, 0xb2, 0xc4, 0xd6); -DEFINE_GUID(MF_MT_WRAPPED_TYPE, 0x4d3f7b23, 0xd02f, 0x4e6c, 0x9b, 0xee, 0xe4, 0xbf, 0x2c, 0x6c, 0x69, 0x5d); -DEFINE_GUID(MF_MT_FIXED_SIZE_SAMPLES, 0xb8ebefaf, 0xb718, 0x4e04, 0xb0, 0xa9, 0x11, 0x67, 0x75, 0xe3, 0x32, 0x1b); -DEFINE_GUID(MF_MT_COMPRESSED, 0x3afd0cee, 0x18f2, 0x4ba5, 0xa1, 0x10, 0x8b, 0xea, 0x50, 0x2e, 0x1f, 0x92); -DEFINE_GUID(MF_MT_SAMPLE_SIZE, 0xdad3ab78, 0x1990, 0x408b, 0xbc, 0xe2, 0xeb, 0xa6, 0x73, 0xda, 0xcc, 0x10); -DEFINE_GUID(MF_MT_VIDEO_3D, 0xcb5e88cf, 0x7b5b, 0x47b6, 0x85, 0xaa, 0x1c, 0xa5, 0xae, 0x18, 0x75, 0x55); -DEFINE_GUID(MF_MT_VIDEO_3D_FORMAT, 0x5315d8a0, 0x87c5, 0x4697, 0xb7, 0x93, 0x66, 0x06, 0xc6, 0x7c, 0x04, 0x9b); -DEFINE_GUID(MF_MT_VIDEO_3D_NUM_VIEWS, 0xbb077e8a, 0xdcbf, 0x42eb, 0xaf, 0x60, 0x41, 0x8d, 0xf9, 0x8a, 0xa4, 0x95); -DEFINE_GUID(MF_MT_VIDEO_3D_LEFT_IS_BASE, 0x6d4b7bff, 0x5629, 0x4404, 0x94, 0x8c, 0xc6, 0x34, 0xf4, 0xce, 0x26, 0xd4); -DEFINE_GUID(MF_MT_VIDEO_3D_FIRST_IS_LEFT, 0xec298493, 0x0ada, 0x4ea1, 0xa4, 0xfe, 0xcb, 0xbd, 0x36, 0xce, 0x93, 0x31); -DEFINE_GUID(MF_MT_VIDEO_CHROMA_SITING, 0x65df2370, 0xc773, 0x4c33, 0xaa, 0x64, 0x84, 0x3e, 0x06, 0x8e, 0xfb, 0x0c); -DEFINE_GUID(MF_MT_VIDEO_LEVEL, 0x96f66574, 0x11c5, 0x4015, 0x86, 0x66, 0xbf, 0xf5, 0x16, 0x43, 0x6d, 0xa7); -DEFINE_GUID(MF_MT_VIDEO_LIGHTING, 0x53a0529c, 0x890b, 0x4216, 0x8b, 0xf9, 0x59, 0x93, 0x67, 0xad, 0x6d, 0x20); -DEFINE_GUID(MF_MT_VIDEO_NOMINAL_RANGE, 0xc21b8ee5, 0xb956, 0x4071, 0x8d, 0xaf, 0x32, 0x5e, 0xdf, 0x5c, 0xab, 0x11); -DEFINE_GUID(MF_MT_VIDEO_PRIMARIES, 0xdbfbe4d7, 0x0740, 0x4ee0, 0x81, 0x92, 0x85, 0x0a, 0xb0, 0xe2, 0x19, 0x35); -DEFINE_GUID(MF_MT_VIDEO_PROFILE, 0xad76a80b, 0x2d5c, 0x4e0b, 0xb3, 0x75, 0x64, 0xe5, 0x20, 0x13, 0x70, 0x36); -DEFINE_GUID(MF_MT_VIDEO_ROTATION, 0xc380465d, 0x2271, 0x428c, 0x9b, 0x83, 0xec, 0xea, 0x3b, 0x4a, 0x85, 0xc1); -DEFINE_GUID(MF_MT_VIDEO_RENDERER_EXTENSION_PROFILE, 0x8437d4b9, 0xd448, 0x4fcd, 0x9b, 0x6b, 0x83, 0x9b, 0xf9, 0x6c, 0x77, 0x98); -DEFINE_GUID(MF_MT_VIDEO_NO_FRAME_ORDERING, 0x3f5b106f, 0x6bc2, 0x4ee3, 0xb7, 0xed, 0x89, 0x02, 0xc1, 0x8f, 0x53, 0x51); -DEFINE_GUID(MF_MT_VIDEO_H264_NO_FMOASO, 0xed461cd6, 0xec9f, 0x416a, 0xa8, 0xa3, 0x26, 0xd7, 0xd3, 0x10, 0x18, 0xd7); -DEFINE_GUID(MF_MT_PAD_CONTROL_FLAGS, 0x4d0e73e5, 0x80ea, 0x4354, 0xa9, 0xd0, 0x11, 0x76, 0xce, 0xb0, 0x28, 0xea); -DEFINE_GUID(MF_MT_PAN_SCAN_APERTURE, 0x79614dde, 0x9187, 0x48fb, 0xb8, 0xc7, 0x4d, 0x52, 0x68, 0x9d, 0xe6, 0x49); -DEFINE_GUID(MF_MT_PAN_SCAN_ENABLED, 0x4b7f6bc3, 0x8b13, 0x40b2, 0xa9, 0x93, 0xab, 0xf6, 0x30, 0xb8, 0x20, 0x4e); -DEFINE_GUID(MF_MT_SECURE, 0xc5acc4fd, 0x0304, 0x4ecf, 0x80, 0x9f, 0x47, 0xbc, 0x97, 0xff, 0x63, 0xbd); -DEFINE_GUID(MF_MT_SOURCE_CONTENT_HINT, 0x68aca3cc, 0x22d0, 0x44e6, 0x85, 0xf8, 0x28, 0x16, 0x71, 0x97, 0xfa, 0x38); -DEFINE_GUID(MF_MT_TIMESTAMP_CAN_BE_DTS, 0x24974215, 0x1b7b, 0x41e4, 0x86, 0x25, 0xac, 0x46, 0x9f, 0x2d, 0xed, 0xaa); -DEFINE_GUID(MF_MT_TRANSFER_FUNCTION, 0x5fb0fce9, 0xbe5c, 0x4935, 0xa8, 0x11, 0xec, 0x83, 0x8f, 0x8e, 0xed, 0x93); -DEFINE_GUID(MF_MT_ALPHA_MODE, 0x5d959b0d, 0x4cbf, 0x4d04, 0x91, 0x9f, 0x3f, 0x5f, 0x7f, 0x28, 0x42, 0x11); -DEFINE_GUID(MF_MT_DEPTH_MEASUREMENT, 0xfd5ac489, 0x0917, 0x4bb6, 0x9d, 0x54, 0x31, 0x22, 0xbf, 0x70, 0x14, 0x4b); -DEFINE_GUID(MF_MT_DEPTH_VALUE_UNIT, 0x21a800f5, 0x3189, 0x4797, 0xbe, 0xba, 0xf1, 0x3c, 0xd9, 0xa3, 0x1a, 0x5e); -DEFINE_GUID(MF_MT_FORWARD_CUSTOM_NALU, 0xed336efd, 0x244f, 0x428d, 0x91, 0x53, 0x28, 0xf3, 0x99, 0x45, 0x88, 0x90); -DEFINE_GUID(MF_MT_FORWARD_CUSTOM_SEI, 0xe27362f1, 0xb136, 0x41d1, 0x95, 0x94, 0x3a, 0x7e, 0x4f, 0xeb, 0xf2, 0xd1); -DEFINE_GUID(MF_MT_AUDIO_NUM_CHANNELS, 0x37e48bf5, 0x645e, 0x4c5b, 0x89, 0xde, 0xad, 0xa9, 0xe2, 0x9b, 0x69, 0x6a); -DEFINE_GUID(MF_MT_AUDIO_SAMPLES_PER_SECOND, 0x5faeeae7, 0x0290, 0x4c31, 0x9e, 0x8a, 0xc5, 0x34, 0xf6, 0x8d, 0x9d, 0xba); -DEFINE_GUID(MF_MT_AUDIO_FLOAT_SAMPLES_PER_SECOND, 0xfb3b724a, 0xcfb5, 0x4319, 0xae, 0xfe, 0x6e, 0x42, 0xb2, 0x40, 0x61, 0x32); -DEFINE_GUID(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 0x1aab75c8, 0xcfef, 0x451c, 0xab, 0x95, 0xac, 0x03, 0x4b, 0x8e, 0x17, 0x31); -DEFINE_GUID(MF_MT_AUDIO_BLOCK_ALIGNMENT, 0x322de230, 0x9eeb, 0x43bd, 0xab, 0x7a, 0xff, 0x41, 0x22, 0x51, 0x54, 0x1d); -DEFINE_GUID(MF_MT_AUDIO_BITS_PER_SAMPLE, 0xf2deb57f, 0x40fa, 0x4764, 0xaa, 0x33, 0xed, 0x4f, 0x2d, 0x1f, 0xf6, 0x69); -DEFINE_GUID(MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, 0xd9bf8d6a, 0x9530, 0x4b7c, 0x9d, 0xdf, 0xff, 0x6f, 0xd5, 0x8b, 0xbd, 0x06); -DEFINE_GUID(MF_MT_AUDIO_SAMPLES_PER_BLOCK, 0xaab15aac, 0xe13a, 0x4995, 0x92, 0x22, 0x50, 0x1e, 0xa1, 0x5c, 0x68, 0x77); -DEFINE_GUID(MF_MT_AUDIO_CHANNEL_MASK, 0x55fb5765, 0x644a, 0x4caf, 0x84, 0x79, 0x93, 0x89, 0x83, 0xbb, 0x15, 0x88); -DEFINE_GUID(MF_MT_AUDIO_FOLDDOWN_MATRIX, 0x9d62927c, 0x36be, 0x4cf1, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); -DEFINE_GUID(MF_MT_AUDIO_WMADRC_PEAKREF, 0x9d62927d, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); -DEFINE_GUID(MF_MT_AUDIO_WMADRC_PEAKTARGET, 0x9d62927e, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); -DEFINE_GUID(MF_MT_AUDIO_WMADRC_AVGREF, 0x9d62927f, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); -DEFINE_GUID(MF_MT_AUDIO_WMADRC_AVGTARGET, 0x9d629280, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); -DEFINE_GUID(MF_MT_AUDIO_PREFER_WAVEFORMATEX, 0xa901aaba, 0xe037, 0x458a, 0xbd, 0xf6, 0x54, 0x5b, 0xe2, 0x07, 0x40, 0x42); -DEFINE_GUID(MF_MT_AUDIO_FLAC_MAX_BLOCK_SIZE, 0x8b81adae, 0x4b5a, 0x4d40, 0x80, 0x22, 0xf3, 0x8d, 0x09, 0xca, 0x3c, 0x5c); -DEFINE_GUID(MF_MT_ORIGINAL_4CC, 0xd7be3fe0, 0x2bc7, 0x492d, 0xb8, 0x43, 0x61, 0xa1, 0x91, 0x9b, 0x70, 0xc3); -DEFINE_GUID(MF_MT_ORIGINAL_WAVE_FORMAT_TAG, 0x8cbbc843, 0x9fd9, 0x49c2, 0x88, 0x2f, 0xa7, 0x25, 0x86, 0xc4, 0x08, 0xad); -DEFINE_GUID(MF_MT_DEFAULT_STRIDE, 0x644b4e48, 0x1e02, 0x4516, 0xb0, 0xeb, 0xc0, 0x1c, 0xa9, 0xd4, 0x9a, 0xc6); -DEFINE_GUID(MF_MT_PALETTE, 0x6d283f42, 0x9846, 0x4410, 0xaf, 0xd9, 0x65, 0x4d, 0x50, 0x3b, 0x1a, 0x54); -DEFINE_GUID(MF_MT_YUV_MATRIX, 0x3e23d450, 0x2c75, 0x4d25, 0xa0, 0x0e, 0xb9, 0x16, 0x70, 0xd1, 0x23, 0x27); - -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_MAX_DYNAMIC_OBJECTS, 0xdcfba24a, 0x2609, 0x4240, 0xa7, 0x21, 0x3f, 0xae, 0xa7, 0x6a, 0x4d, 0xf9); -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_OBJECT_METADATA_FORMAT_ID, 0x2ab71bc0, 0x6223, 0x4ba7, 0xad, 0x64, 0x7b, 0x94, 0xb4, 0x7a, 0xe7, 0x92); -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_OBJECT_METADATA_LENGTH, 0x094ba8be, 0xd723, 0x489f, 0x92, 0xfa, 0x76, 0x67, 0x77, 0xb3, 0x47, 0x26); -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_MAX_METADATA_ITEMS, 0x11aa80b4, 0xe0da, 0x47c6, 0x80, 0x60, 0x96, 0xc1, 0x25, 0x9a, 0xe5, 0x0d); -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_MIN_METADATA_ITEM_OFFSET_SPACING, 0x83e96ec9, 0x1184, 0x417e, 0x82, 0x54, 0x9f, 0x26, 0x91, 0x58, 0xfc, 0x06); -DEFINE_GUID(MF_MT_SPATIAL_AUDIO_DATA_PRESENT, 0x6842f6e7, 0xd43e, 0x4ebb, 0x9c, 0x9c, 0xc9, 0x6f, 0x41, 0x78, 0x48, 0x63); - -DEFINE_GUID(MF_MT_AAC_PAYLOAD_TYPE, 0xbfbabe79, 0x7434, 0x4d1c, 0x94, 0xf0, 0x72, 0xa3, 0xb9, 0xe1, 0x71, 0x88); -DEFINE_GUID(MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, 0x7632f0e6, 0x9538, 0x4d61, 0xac, 0xda, 0xea, 0x29, 0xc8, 0xc1, 0x44, 0x56); - -DEFINE_GUID(MF_MT_MPEG_START_TIME_CODE, 0x91f67885, 0x4333, 0x4280, 0x97, 0xcd, 0xbd, 0x5a, 0x6c, 0x03, 0xa0, 0x6e); -DEFINE_GUID(MF_MT_MPEG2_PROFILE, 0xad76a80b, 0x2d5c, 0x4e0b, 0xb3, 0x75, 0x64, 0xe5, 0x20, 0x13, 0x70, 0x36); -DEFINE_GUID(MF_MT_MPEG2_LEVEL, 0x96f66574, 0x11c5, 0x4015, 0x86, 0x66, 0xbf, 0xf5, 0x16, 0x43, 0x6d, 0xa7); -DEFINE_GUID(MF_MT_MPEG2_FLAGS, 0x31e3991d, 0xf701, 0x4b2f, 0xb4, 0x26, 0x8a, 0xe3, 0xbd, 0xa9, 0xe0, 0x4b); -DEFINE_GUID(MF_MT_MPEG_SEQUENCE_HEADER, 0x3c036de7, 0x3ad0, 0x4c9e, 0x92, 0x16, 0xee, 0x6d, 0x6a, 0xc2, 0x1c, 0xb3); -DEFINE_GUID(MF_MT_MPEG2_STANDARD, 0xa20af9e8, 0x928a, 0x4b26, 0xaa, 0xa9, 0xf0, 0x5c, 0x74, 0xca, 0xc4, 0x7c); -DEFINE_GUID(MF_MT_MPEG2_TIMECODE, 0x5229ba10, 0xe29d, 0x4f80, 0xa5, 0x9c, 0xdf, 0x4f, 0x18, 0x02, 0x07, 0xd2); -DEFINE_GUID(MF_MT_MPEG2_CONTENT_PACKET, 0x825d55e4, 0x4f12, 0x4197, 0x9e, 0xb3, 0x59, 0xb6, 0xe4, 0x71, 0x0f, 0x06); -DEFINE_GUID(MF_MT_MPEG2_ONE_FRAME_PER_PACKET, 0x91a49eb5, 0x1d20, 0x4b42, 0xac, 0xe8, 0x80, 0x42, 0x69, 0xbf, 0x95, 0xed); -DEFINE_GUID(MF_MT_MPEG2_HDCP, 0x168f1b4a, 0x3e91, 0x450f, 0xae, 0xa7, 0xe4, 0xba, 0xea, 0xda, 0xe5, 0xba); - -DEFINE_GUID(MF_MT_H264_MAX_CODEC_CONFIG_DELAY, 0xf5929986, 0x4c45, 0x4fbb, 0xbb, 0x49, 0x6c, 0xc5, 0x34, 0xd0, 0x5b, 0x9b); -DEFINE_GUID(MF_MT_H264_SUPPORTED_SLICE_MODES, 0xc8be1937, 0x4d64, 0x4549, 0x83, 0x43, 0xa8, 0x08, 0x6c, 0x0b, 0xfd, 0xa5); -DEFINE_GUID(MF_MT_H264_SUPPORTED_SYNC_FRAME_TYPES, 0x89a52c01, 0xf282, 0x48d2, 0xb5, 0x22, 0x22, 0xe6, 0xae, 0x63, 0x31, 0x99); -DEFINE_GUID(MF_MT_H264_RESOLUTION_SCALING, 0xe3854272, 0xf715, 0x4757, 0xba, 0x90, 0x1b, 0x69, 0x6c, 0x77, 0x34, 0x57); -DEFINE_GUID(MF_MT_H264_SIMULCAST_SUPPORT, 0x9ea2d63d, 0x53f0, 0x4a34, 0xb9, 0x4e, 0x9d, 0xe4, 0x9a, 0x07, 0x8c, 0xb3); -DEFINE_GUID(MF_MT_H264_SUPPORTED_RATE_CONTROL_MODES, 0x6a8ac47e, 0x519c, 0x4f18, 0x9b, 0xb3, 0x7e, 0xea, 0xae, 0xa5, 0x59, 0x4d); -DEFINE_GUID(MF_MT_H264_MAX_MB_PER_SEC, 0x45256d30, 0x7215, 0x4576, 0x93, 0x36, 0xb0, 0xf1, 0xbc, 0xd5, 0x9b, 0xb2); -DEFINE_GUID(MF_MT_H264_SUPPORTED_USAGES, 0x60b1a998, 0xdc01, 0x40ce, 0x97, 0x36, 0xab, 0xa8, 0x45, 0xa2, 0xdb, 0xdc); -DEFINE_GUID(MF_MT_H264_CAPABILITIES, 0xbb3bd508, 0x490a, 0x11e0, 0x99, 0xe4, 0x13, 0x16, 0xdf, 0xd7, 0x20, 0x85); -DEFINE_GUID(MF_MT_H264_SVC_CAPABILITIES, 0xf8993abe, 0xd937, 0x4a8f, 0xbb, 0xca, 0x69, 0x66, 0xfe, 0x9e, 0x11, 0x52); - -DEFINE_GUID(MF_MT_H264_USAGE, 0x359ce3a5, 0xaf00, 0x49ca, 0xa2, 0xf4, 0x2a, 0xc9, 0x4c, 0xa8, 0x2b, 0x61); -DEFINE_GUID(MF_MT_H264_RATE_CONTROL_MODES,0x705177d8, 0x45cb, 0x11e0, 0xac, 0x7d, 0xb9, 0x1c, 0xe0, 0xd7, 0x20, 0x85); -DEFINE_GUID(MF_MT_H264_LAYOUT_PER_STREAM, 0x85e299b2, 0x90e3, 0x4fe8, 0xb2, 0xf5, 0xc0, 0x67, 0xe0, 0xbf, 0xe5, 0x7a); -DEFINE_GUID(MF_MT_IN_BAND_PARAMETER_SET, 0x75da5090, 0x910b, 0x4a03, 0x89, 0x6c, 0x7b, 0x89, 0x8f, 0xee, 0xa5, 0xaf); -DEFINE_GUID(MF_MT_MPEG4_TRACK_TYPE, 0x54f486dd, 0x9327, 0x4f6d, 0x80, 0xab, 0x6f, 0x70, 0x9e, 0xbb, 0x4c, 0xce); - -DEFINE_GUID(MF_MT_DV_AAUX_SRC_PACK_0, 0x84bd5d88, 0x0fb8, 0x4ac8, 0xbe, 0x4b, 0xa8, 0x84, 0x8b, 0xef, 0x98, 0xf3); -DEFINE_GUID(MF_MT_DV_AAUX_CTRL_PACK_0, 0xf731004e, 0x1dd1, 0x4515, 0xaa, 0xbe, 0xf0, 0xc0, 0x6a, 0xa5, 0x36, 0xac); -DEFINE_GUID(MF_MT_DV_AAUX_SRC_PACK_1, 0x720e6544, 0x0225, 0x4003, 0xa6, 0x51, 0x01, 0x96, 0x56, 0x3a, 0x95, 0x8e); -DEFINE_GUID(MF_MT_DV_AAUX_CTRL_PACK_1, 0xcd1f470d, 0x1f04, 0x4fe0, 0xbf, 0xb9, 0xd0, 0x7a, 0xe0, 0x38, 0x6a, 0xd8); -DEFINE_GUID(MF_MT_DV_VAUX_SRC_PACK, 0x41402d9d, 0x7b57, 0x43c6, 0xb1, 0x29, 0x2c, 0xb9, 0x97, 0xf1, 0x50, 0x09); -DEFINE_GUID(MF_MT_DV_VAUX_CTRL_PACK, 0x2f84e1c4, 0x0da1, 0x4788, 0x93, 0x8e, 0x0d, 0xfb, 0xfb, 0xb3, 0x4b, 0x48); - -DEFINE_GUID(MF_MT_ARBITRARY_HEADER, 0x9e6bd6f5, 0x0109, 0x4f95, 0x84, 0xac, 0x93, 0x09, 0x15, 0x3a, 0x19, 0xfc); -DEFINE_GUID(MF_MT_ARBITRARY_FORMAT, 0x5a75b249, 0x0d7d, 0x49a1, 0xa1, 0xc3, 0xe0, 0xd8, 0x7f, 0x0c, 0xad, 0xe5); - -DEFINE_GUID(MFT_CATEGORY_VIDEO_DECODER, 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91); -DEFINE_GUID(MFT_CATEGORY_VIDEO_ENCODER, 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a); -DEFINE_GUID(MFT_CATEGORY_VIDEO_EFFECT, 0x12e17c21, 0x532c, 0x4a6e, 0x8a, 0x1c, 0x40, 0x82, 0x5a, 0x73, 0x63, 0x97); -DEFINE_GUID(MFT_CATEGORY_MULTIPLEXER, 0x059c561e, 0x05ae, 0x4b61, 0xb6, 0x9d, 0x55, 0xb6, 0x1e, 0xe5, 0x4a, 0x7b); -DEFINE_GUID(MFT_CATEGORY_DEMULTIPLEXER, 0xa8700a7a, 0x939b, 0x44c5, 0x99, 0xd7, 0x76, 0x22, 0x6b, 0x23, 0xb3, 0xf1); -DEFINE_GUID(MFT_CATEGORY_AUDIO_DECODER, 0x9ea73fb4, 0xef7a, 0x4559, 0x8d, 0x5d, 0x71, 0x9d, 0x8f, 0x04, 0x26, 0xc7); -DEFINE_GUID(MFT_CATEGORY_AUDIO_ENCODER, 0x91c64bd0, 0xf91e, 0x4d8c, 0x92, 0x76, 0xdb, 0x24, 0x82, 0x79, 0xd9, 0x75); -DEFINE_GUID(MFT_CATEGORY_AUDIO_EFFECT, 0x11064c48, 0x3648, 0x4ed0, 0x93, 0x2e, 0x05, 0xce, 0x8a, 0xc8, 0x11, 0xb7); -DEFINE_GUID(MFT_CATEGORY_VIDEO_PROCESSOR, 0x302ea3fc, 0xaa5f, 0x47f9, 0x9f, 0x7a, 0xc2, 0x18, 0x8b, 0xb1, 0x63, 0x02); -DEFINE_GUID(MFT_CATEGORY_OTHER, 0x90175d57, 0xb7ea, 0x4901, 0xae, 0xb3, 0x93, 0x3a, 0x87, 0x47, 0x75, 0x6f); -DEFINE_GUID(MFT_ENUM_ADAPTER_LUID, 0x1d39518c, 0xe220, 0x4da8, 0xa0, 0x7f, 0xba, 0x17, 0x25, 0x52, 0xd6, 0xb1); -DEFINE_GUID(MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE, 0x53476a11, 0x3f13, 0x49fb, 0xac, 0x42, 0xee, 0x27, 0x33, 0xc9, 0x67, 0x41); - -DEFINE_GUID(MFMediaType_Audio, 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -DEFINE_GUID(MFMediaType_Binary, 0x72178c25, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); -DEFINE_GUID(MFMediaType_Default, 0x81a412e6, 0x8103, 0x4b06, 0x85, 0x7f, 0x18, 0x62, 0x78, 0x10, 0x24, 0xac); -DEFINE_GUID(MFMediaType_FileTransfer, 0x72178c26, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); -DEFINE_GUID(MFMediaType_HTML, 0x72178c24, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); -DEFINE_GUID(MFMediaType_Image, 0x72178c23, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); -DEFINE_GUID(MFMediaType_MultiplexedFrames, 0x6ea542b0, 0x281f, 0x4231, 0xa4, 0x64, 0xfe, 0x2f, 0x50, 0x22, 0x50, 0x1c); -DEFINE_GUID(MFMediaType_Perception, 0x597ff6f9, 0x6ea2, 0x4670, 0x85, 0xb4, 0xea, 0x84, 0x07, 0x3f, 0xe9, 0x40); -DEFINE_GUID(MFMediaType_Protected, 0x7b4b6fe6, 0x9d04, 0x4494, 0xbe, 0x14, 0x7e, 0x0b, 0xd0, 0x76, 0xc8, 0xe4); -DEFINE_GUID(MFMediaType_SAMI, 0xe69669a0, 0x3dcd, 0x40cb, 0x9e, 0x2e, 0x37, 0x08, 0x38, 0x7c, 0x06, 0x16); -DEFINE_GUID(MFMediaType_Script, 0x72178c22, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); -DEFINE_GUID(MFMediaType_Stream, 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(MFMediaType_Subtitle, 0xa6d13581, 0xed50, 0x4e65, 0xae, 0x08, 0x26, 0x06, 0x55, 0x76, 0xaa, 0xcc); -DEFINE_GUID(MFMediaType_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); - -DEFINE_GUID(MFSampleExtension_DecodeTimestamp, 0x73a954d4, 0x09e2, 0x4861, 0xbe, 0xfc, 0x94, 0xbd, 0x97, 0xc0, 0x8e, 0x6e); -DEFINE_GUID(MFSampleExtension_Timestamp, 0x1e436999, 0x69be, 0x4c7a, 0x93, 0x69, 0x70, 0x06, 0x8c, 0x02, 0x60, 0xcb); -DEFINE_GUID(MFSampleExtension_Token, 0x8294da66, 0xf328, 0x4805, 0xb5, 0x51, 0x00, 0xde, 0xb4, 0xc5, 0x7a, 0x61); -DEFINE_GUID(MFSampleExtension_3DVideo, 0xf86f97a4, 0xdd54, 0x4e2e, 0x9a, 0x5e, 0x55, 0xfc, 0x2d, 0x74, 0xa0, 0x05); -DEFINE_GUID(MFSampleExtension_3DVideo_SampleFormat, 0x08671772, 0xe36f, 0x4cff, 0x97, 0xb3, 0xd7, 0x2e, 0x20, 0x98, 0x7a, 0x48); -DEFINE_GUID(MFSampleExtension_TargetGlobalLuminance, 0x3f60ef36, 0x31ef, 0x4daf, 0x83, 0x60, 0x94, 0x03, 0x97, 0xe4, 0x1e, 0xf3); -DEFINE_GUID(MFSampleExtension_ForwardedDecodeUnits, 0x424c754c, 0x97c8, 0x48d6, 0x87, 0x77, 0xfc, 0x41, 0xf7, 0xb6, 0x08, 0x79); -DEFINE_GUID(MFSampleExtension_ForwardedDecodeUnitType, 0x089e57c7, 0x47d3, 0x4a26, 0xbf, 0x9c, 0x4b, 0x64, 0xfa, 0xfb, 0x5d, 0x1e); - -DEFINE_GUID(MF_EVENT_DO_THINNING, 0x321ea6fb, 0xdad9, 0x46e4, 0xb3, 0x1d, 0xd2, 0xea, 0xe7, 0x09, 0x0e, 0x30); -DEFINE_GUID(MF_EVENT_MFT_CONTEXT, 0xb7cd31f1, 0x899e, 0x4b41, 0x80, 0xc9, 0x26, 0xa8, 0x96, 0xd3, 0x29, 0x77); -DEFINE_GUID(MF_EVENT_MFT_INPUT_STREAM_ID, 0xf29c2cca, 0x7ae6, 0x42d2, 0xb2, 0x84, 0xbf, 0x83, 0x7c, 0xc8, 0x74, 0xe2); -DEFINE_GUID(MF_EVENT_PRESENTATION_TIME_OFFSET, 0x5ad914d1, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); -DEFINE_GUID(MF_EVENT_SCRUBSAMPLE_TIME, 0x9ac712b3, 0xdcb8, 0x44d5, 0x8d, 0x0c, 0x37, 0x45, 0x5a, 0x27, 0x82, 0xe3); -DEFINE_GUID(MF_EVENT_SESSIONCAPS, 0x7e5ebcd0, 0x11b8, 0x4abe, 0xaf, 0xad, 0x10, 0xf6, 0x59, 0x9a, 0x7f, 0x42); -DEFINE_GUID(MF_EVENT_SESSIONCAPS_DELTA, 0x7e5ebcd1, 0x11b8, 0x4abe, 0xaf, 0xad, 0x10, 0xf6, 0x59, 0x9a, 0x7f, 0x42); -DEFINE_GUID(MF_EVENT_SOURCE_ACTUAL_START, 0xa8cc55a9, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); -DEFINE_GUID(MF_EVENT_SOURCE_CHARACTERISTICS, 0x47db8490, 0x8b22, 0x4f52, 0xaf, 0xda, 0x9c, 0xe1, 0xb2, 0xd3, 0xcf, 0xa8); -DEFINE_GUID(MF_EVENT_SOURCE_CHARACTERISTICS_OLD, 0x47db8491, 0x8b22, 0x4f52, 0xaf, 0xda, 0x9c, 0xe1, 0xb2, 0xd3, 0xcf, 0xa8); -DEFINE_GUID(MF_EVENT_SOURCE_FAKE_START, 0xa8cc55a7, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); -DEFINE_GUID(MF_EVENT_SOURCE_PROJECTSTART, 0xa8cc55a8, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); -DEFINE_GUID(MF_EVENT_SOURCE_TOPOLOGY_CANCELED, 0xdb62f650, 0x9a5e, 0x4704, 0xac, 0xf3, 0x56, 0x3b, 0xc6, 0xa7, 0x33, 0x64); -DEFINE_GUID(MF_EVENT_START_PRESENTATION_TIME, 0x5ad914d0, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); -DEFINE_GUID(MF_EVENT_START_PRESENTATION_TIME_AT_OUTPUT, 0x5ad914d2, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); -DEFINE_GUID(MF_EVENT_STREAM_METADATA_CONTENT_KEYIDS, 0x5063449d, 0xcc29, 0x4fc6, 0xa7, 0x5a, 0xd2, 0x47, 0xb3, 0x5a, 0xf8, 0x5c); -DEFINE_GUID(MF_EVENT_STREAM_METADATA_KEYDATA, 0xcd59a4a1, 0x4a3b, 0x4bbd, 0x86, 0x65, 0x72, 0xa4, 0x0f, 0xbe, 0xa7, 0x76); -DEFINE_GUID(MF_EVENT_STREAM_METADATA_SYSTEMID, 0x1ea2ef64, 0xba16, 0x4a36, 0x87, 0x19, 0xfe, 0x75, 0x60, 0xba, 0x32, 0xad); -DEFINE_GUID(MF_EVENT_TOPOLOGY_STATUS, 0x30c5018d, 0x9a53, 0x454b, 0xad, 0x9e, 0x6d, 0x5f, 0x8f, 0xa7, 0xc4, 0x3b); -DEFINE_GUID(MF_EVENT_OUTPUT_NODE, 0x830f1a8b, 0xc060, 0x46dd, 0xa8, 0x01, 0x1c, 0x95, 0xde, 0xc9, 0xb1, 0x07); - -DEFINE_GUID(MF_LOW_LATENCY, 0x9c27891a, 0xed7a, 0x40e1, 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee); -DEFINE_GUID(MF_VIDEO_MAX_MB_PER_SEC, 0xe3f2e203, 0xd445, 0x4b8c, 0x92, 0x11, 0xae, 0x39, 0x0d, 0x3b, 0xa0, 0x17); -DEFINE_GUID(MF_DISABLE_FRAME_CORRUPTION_INFO, 0x7086e16c, 0x49c5, 0x4201, 0x88, 0x2a, 0x85, 0x38, 0xf3, 0x8c, 0xf1, 0x3a); - -typedef unsigned __int64 MFWORKITEM_KEY; - -typedef enum -{ - MF_STANDARD_WORKQUEUE, - MF_WINDOW_WORKQUEUE, - MF_MULTITHREADED_WORKQUEUE, -} MFASYNC_WORKQUEUE_TYPE; - -typedef void (CALLBACK *MFPERIODICCALLBACK)(IUnknown *context); - -#define MF_1_BYTE_ALIGNMENT 0x00000000 -#define MF_2_BYTE_ALIGNMENT 0x00000001 -#define MF_4_BYTE_ALIGNMENT 0x00000003 -#define MF_8_BYTE_ALIGNMENT 0x00000007 -#define MF_16_BYTE_ALIGNMENT 0x0000000f -#define MF_32_BYTE_ALIGNMENT 0x0000001f -#define MF_64_BYTE_ALIGNMENT 0x0000003f -#define MF_128_BYTE_ALIGNMENT 0x0000007f -#define MF_256_BYTE_ALIGNMENT 0x000000ff -#define MF_512_BYTE_ALIGNMENT 0x000001ff -#define MF_1024_BYTE_ALIGNMENT 0x000003ff -#define MF_2048_BYTE_ALIGNMENT 0x000007ff -#define MF_4096_BYTE_ALIGNMENT 0x00000fff -#define MF_8192_BYTE_ALIGNMENT 0x00001fff - -typedef enum _MFWaveFormatExConvertFlags -{ - MFWaveFormatExConvertFlag_Normal = 0, - MFWaveFormatExConvertFlag_ForceExtensible = 1, -} MFWaveFormatExConvertFlags; - -enum _MFT_ENUM_FLAG -{ - MFT_ENUM_FLAG_SYNCMFT = 0x00000001, - MFT_ENUM_FLAG_ASYNCMFT = 0x00000002, - MFT_ENUM_FLAG_HARDWARE = 0x00000004, - MFT_ENUM_FLAG_FIELDOFUSE = 0x00000008, - MFT_ENUM_FLAG_LOCALMFT = 0x00000010, - MFT_ENUM_FLAG_TRANSCODE_ONLY = 0x00000020, - MFT_ENUM_FLAG_ALL = 0x0000003f, - MFT_ENUM_FLAG_SORTANDFILTER = 0x00000040, - MFT_ENUM_FLAG_SORTANDFILTER_APPROVED_ONLY = 0x000000c0, - MFT_ENUM_FLAG_SORTANDFILTER_WEB_ONLY = 0x00000140, - MFT_ENUM_FLAG_SORTANDFILTER_WEB_ONLY_EDGEMODE = 0x00000240, - MFT_ENUM_FLAG_UNTRUSTED_STOREMFT = 0x00000400, -}; - -typedef enum -{ - MF_TOPOSTATUS_INVALID = 0, - MF_TOPOSTATUS_READY = 100, - MF_TOPOSTATUS_STARTED_SOURCE = 200, - MF_TOPOSTATUS_DYNAMIC_CHANGED = 210, - MF_TOPOSTATUS_SINK_SWITCHED = 300, - MF_TOPOSTATUS_ENDED = 400, -} MF_TOPOSTATUS; - -/* Media Session capabilities. */ -#define MFSESSIONCAP_START 0x00000001 -#define MFSESSIONCAP_SEEK 0x00000002 -#define MFSESSIONCAP_PAUSE 0x00000004 -#define MFSESSIONCAP_RATE_FORWARD 0x00000010 -#define MFSESSIONCAP_RATE_REVERSE 0x00000020 -#define MFSESSIONCAP_DOES_NOT_USE_NETWORK 0x00000040 - -#define MF_E_DXGI_DEVICE_NOT_INITIALIZED ((HRESULT)0x80041000) -#define MF_E_DXGI_NEW_VIDEO_DEVICE ((HRESULT)0x80041001) -#define MF_E_DXGI_VIDEO_DEVICE_LOCKED ((HRESULT)0x80041002) - -HRESULT WINAPI MFAddPeriodicCallback(MFPERIODICCALLBACK callback, IUnknown *context, DWORD *key); -HRESULT WINAPI MFAllocateSerialWorkQueue(DWORD target_queue, DWORD *queue); -HRESULT WINAPI MFAllocateWorkQueue(DWORD *queue); -HRESULT WINAPI MFAllocateWorkQueueEx(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue); -HRESULT WINAPI MFBeginCreateFile(MF_FILE_ACCESSMODE access_mode, MF_FILE_OPENMODE open_mode, MF_FILE_FLAGS flags, - const WCHAR *path, IMFAsyncCallback *callback, IUnknown *state, IUnknown **cancel_cookie); -HRESULT WINAPI MFBeginRegisterWorkQueueWithMMCSS(DWORD queue, const WCHAR *usage_class, DWORD taskid, - IMFAsyncCallback *callback, IUnknown *state); -HRESULT WINAPI MFBeginRegisterWorkQueueWithMMCSSEx(DWORD queue, const WCHAR *usage_class, DWORD taskid, LONG priority, - IMFAsyncCallback *callback, IUnknown *state); -HRESULT WINAPI MFBeginUnregisterWorkQueueWithMMCSS(DWORD queue, IMFAsyncCallback *callback, IUnknown *state); -HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height, UINT32 *size); -HRESULT WINAPI MFCancelCreateFile(IUnknown *cancel_cookie); -HRESULT WINAPI MFCancelWorkItem(MFWORKITEM_KEY key); -BOOL WINAPI MFCompareFullToPartialMediaType(IMFMediaType *full_type, IMFMediaType *partial_type); -HRESULT WINAPI MFConvertColorInfoToDXVA(DWORD *dxva_info, const MFVIDEOFORMAT *format); -HRESULT WINAPI MFCopyImage(BYTE *dest, LONG deststride, const BYTE *src, LONG srcstride, DWORD width, DWORD lines); -HRESULT WINAPI MFCreate2DMediaBuffer(DWORD width, DWORD height, DWORD fourcc, BOOL bottom_up, IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateAlignedMemoryBuffer(DWORD max_length, DWORD alignment, IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size); -HRESULT WINAPI MFCreateAsyncResult(IUnknown *object, IMFAsyncCallback *callback, IUnknown *state, IMFAsyncResult **result); -HRESULT WINAPI MFCreateAudioMediaType(const WAVEFORMATEX *audioformat, IMFAudioMediaType **mediatype); -HRESULT WINAPI MFCreateCollection(IMFCollection **collection); -HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **manager); -HRESULT WINAPI MFCreateDXGISurfaceBuffer(REFIID riid, IUnknown *surface, UINT subresource, BOOL bottomup, - IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateDXSurfaceBuffer(REFIID riid, IUnknown *surface, BOOL bottom_up, IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue); -HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE openmode, MF_FILE_FLAGS flags, - LPCWSTR url, IMFByteStream **bytestream); -HRESULT WINAPI MFCreateMediaBufferFromMediaType(IMFMediaType *media_type, LONGLONG duration, DWORD min_length, - DWORD min_alignment, IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HRESULT status, - const PROPVARIANT *value, IMFMediaEvent **event); -HRESULT WINAPI MFCreateMediaType(IMFMediaType **type); -HRESULT WINAPI MFCreateMFVideoFormatFromMFMediaType(IMFMediaType *media_type, MFVIDEOFORMAT **video_format, UINT32 *size); -HRESULT WINAPI MFCreateSample(IMFSample **sample); -HRESULT WINAPI MFCreateVideoMediaTypeFromSubtype(const GUID *subtype, IMFVideoMediaType **media_type); -HRESULT WINAPI MFCreateVideoSampleAllocatorEx(REFIID riid, void **allocator); -HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer); -HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *type, WAVEFORMATEX **format, UINT32 *size, UINT32 flags); -HRESULT WINAPI MFEndCreateFile(IMFAsyncResult *result, IMFByteStream **stream); -HRESULT WINAPI MFEndRegisterWorkQueueWithMMCSS(IMFAsyncResult *result, DWORD *taskid); -HRESULT WINAPI MFEndUnregisterWorkQueueWithMMCSS(IMFAsyncResult *result); -HRESULT WINAPI MFFrameRateToAverageTimePerFrame(UINT32 numerator, UINT32 denominator, UINT64 *avgtime); -void * WINAPI MFHeapAlloc(SIZE_T size, ULONG flags, char *file, int line, EAllocationType type); -void WINAPI MFHeapFree(void *ptr); -HRESULT WINAPI MFGetAttributesAsBlob(IMFAttributes *attributes, UINT8 *buffer, UINT size); -HRESULT WINAPI MFGetAttributesAsBlobSize(IMFAttributes *attributes, UINT32 *size); -HRESULT WINAPI MFGetStrideForBitmapInfoHeader(DWORD format, DWORD width, LONG *stride); -HRESULT WINAPI MFGetPlaneSize(DWORD format, DWORD width, DWORD height, DWORD *size); -HRESULT WINAPI MFGetTimerPeriodicity(DWORD *periodicity); -HRESULT WINAPI MFGetWorkQueueMMCSSClass(DWORD queue, WCHAR *mmcss_class, DWORD *length); -HRESULT WINAPI MFGetWorkQueueMMCSSPriority(DWORD queue, LONG *priority); -HRESULT WINAPI MFGetWorkQueueMMCSSTaskId(DWORD queue, DWORD *taskid); -HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type, - MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes, - CLSID **pclsids, UINT32 *pcount); -HRESULT WINAPI MFTEnum2(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type, - const MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes, IMFActivate ***activate, UINT32 *count); -HRESULT WINAPI MFTEnumEx(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type, - const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate, - UINT32 *pcount); -HRESULT WINAPI MFInitAttributesFromBlob(IMFAttributes *attributes, const UINT8 *buffer, UINT size); -HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WAVEFORMATEX *format, UINT32 size); -HRESULT WINAPI MFInvokeCallback(IMFAsyncResult *result); -LONGLONG WINAPI MFllMulDiv(LONGLONG val, LONGLONG num, LONGLONG denom, LONGLONG factor); -HRESULT WINAPI MFLockDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **manager); -HRESULT WINAPI MFLockPlatform(void); -HRESULT WINAPI MFLockSharedWorkQueue(const WCHAR *name, LONG base_priority, DWORD *taskid, DWORD *queue); -DXGI_FORMAT WINAPI MFMapDX9FormatToDXGIFormat(DWORD format); -DWORD WINAPI MFMapDXGIFormatToDX9Format(DXGI_FORMAT dxgi_format); -HRESULT WINAPI MFPutWaitingWorkItem(HANDLE event, LONG priority, IMFAsyncResult *result, MFWORKITEM_KEY *key); -HRESULT WINAPI MFPutWorkItem(DWORD queue, IMFAsyncCallback *callback, IUnknown *state); -HRESULT WINAPI MFPutWorkItem2(DWORD queue, LONG priority, IMFAsyncCallback *callback, IUnknown *state); -HRESULT WINAPI MFPutWorkItemEx(DWORD queue, IMFAsyncResult *result); -HRESULT WINAPI MFPutWorkItemEx2(DWORD queue, LONG priority, IMFAsyncResult *result); -HRESULT WINAPI MFRegisterLocalByteStreamHandler(const WCHAR *extension, const WCHAR *mime, IMFActivate *activate); -HRESULT WINAPI MFRegisterLocalSchemeHandler(const WCHAR *scheme, IMFActivate *activate); -HRESULT WINAPI MFRegisterPlatformWithMMCSS(const WCHAR *usage_class, DWORD *taskid, LONG priority); -HRESULT WINAPI MFScheduleWorkItem(IMFAsyncCallback *callback, IUnknown *state, INT64 timeout, MFWORKITEM_KEY *key); -HRESULT WINAPI MFScheduleWorkItemEx(IMFAsyncResult *result, INT64 timeout, MFWORKITEM_KEY *key); -HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags, UINT32 cinput, - MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput, - MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes); -HRESULT WINAPI MFTRegisterLocal(IClassFactory *factory, REFGUID category, LPCWSTR name, - UINT32 flags, UINT32 cinput, const MFT_REGISTER_TYPE_INFO *input_types, - UINT32 coutput, const MFT_REGISTER_TYPE_INFO* output_types); -HRESULT WINAPI MFTRegisterLocalByCLSID(REFCLSID clsid, REFGUID category, LPCWSTR name, UINT32 flags, - UINT32 input_count, const MFT_REGISTER_TYPE_INFO *input_types, UINT32 output_count, - const MFT_REGISTER_TYPE_INFO *output_types); -HRESULT WINAPI MFRemovePeriodicCallback(DWORD key); -HRESULT WINAPI MFShutdown(void); -HRESULT WINAPI MFStartup(ULONG version, DWORD flags); -HRESULT WINAPI MFUnlockDXGIDeviceManager(void); -HRESULT WINAPI MFUnlockPlatform(void); -HRESULT WINAPI MFUnlockWorkQueue(DWORD queue); -HRESULT WINAPI MFUnregisterPlatformFromMMCSS(void); -HRESULT WINAPI MFTUnregister(CLSID clsid); -HRESULT WINAPI MFTUnregisterLocal(IClassFactory *factory); -HRESULT WINAPI MFTUnregisterLocalByCLSID(CLSID clsid); -HRESULT WINAPI MFGetPluginControl(IMFPluginControl**); -HRESULT WINAPI MFWrapMediaType(IMFMediaType *original, REFGUID major, REFGUID subtype, IMFMediaType **wrapped); -HRESULT WINAPI MFUnwrapMediaType(IMFMediaType *wrapped, IMFMediaType **original); - -#if defined(__cplusplus) -} -#endif - -#endif /* __WINE_MFAPI_H */ diff --git a/wrappers/to-synch/sdk/include/dxsdk/mferror.h b/wrappers/to-synch/sdk/include/dxsdk/mferror.h deleted file mode 100644 index 3cf3ca1eb86..00000000000 --- a/wrappers/to-synch/sdk/include/dxsdk/mferror.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright (C) 2014 Sebastian Lackner - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_MFERROR_H -#define __WINE_MFERROR_H - -#define FACILITY_MF 0xd - -#define MF_E_PLATFORM_NOT_INITIALIZED _HRESULT_TYPEDEF_(0xc00d36b0) -#define MF_E_BUFFERTOOSMALL _HRESULT_TYPEDEF_(0xc00d36b1) -#define MF_E_INVALIDREQUEST _HRESULT_TYPEDEF_(0xc00d36b2) -#define MF_E_INVALIDSTREAMNUMBER _HRESULT_TYPEDEF_(0xc00d36b3) -#define MF_E_INVALIDMEDIATYPE _HRESULT_TYPEDEF_(0xc00d36b4) -#define MF_E_NOTACCEPTING _HRESULT_TYPEDEF_(0xc00d36b5) -#define MF_E_NOT_INITIALIZED _HRESULT_TYPEDEF_(0xc00d36b6) -#define MF_E_UNSUPPORTED_REPRESENTATION _HRESULT_TYPEDEF_(0xc00d36b7) -#define MF_E_NO_MORE_TYPES _HRESULT_TYPEDEF_(0xc00d36b9) -#define MF_E_UNSUPPORTED_SERVICE _HRESULT_TYPEDEF_(0xc00d36ba) -#define MF_E_UNEXPECTED _HRESULT_TYPEDEF_(0xc00d36bb) -#define MF_E_INVALIDNAME _HRESULT_TYPEDEF_(0xc00d36bc) -#define MF_E_INVALIDTYPE _HRESULT_TYPEDEF_(0xc00d36bd) -#define MF_E_INVALID_FILE_FORMAT _HRESULT_TYPEDEF_(0xc00d36be) -#define MF_E_INVALIDINDEX _HRESULT_TYPEDEF_(0xc00d36bf) -#define MF_E_INVALID_TIMESTAMP _HRESULT_TYPEDEF_(0xc00d36c0) -#define MF_E_UNSUPPORTED_SCHEME _HRESULT_TYPEDEF_(0xc00d36c3) -#define MF_E_UNSUPPORTED_BYTESTREAM_TYPE _HRESULT_TYPEDEF_(0xc00d36c4) -#define MF_E_UNSUPPORTED_TIME_FORMAT _HRESULT_TYPEDEF_(0xc00d36c5) -#define MF_E_NO_SAMPLE_TIMESTAMP _HRESULT_TYPEDEF_(0xc00d36c8) -#define MF_E_NO_SAMPLE_DURATION _HRESULT_TYPEDEF_(0xc00d36c9) -#define MF_E_INVALID_STREAM_DATA _HRESULT_TYPEDEF_(0xc00d36cb) -#define MF_E_RT_UNAVAILABLE _HRESULT_TYPEDEF_(0xc00d36cf) -#define MF_E_UNSUPPORTED_RATE _HRESULT_TYPEDEF_(0xc00d36d0) -#define MF_E_THINNING_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d36d1) -#define MF_E_REVERSE_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d36d2) -#define MF_E_UNSUPPORTED_RATE_TRANSITION _HRESULT_TYPEDEF_(0xc00d36d3) -#define MF_E_RATE_CHANGE_PREEMPTED _HRESULT_TYPEDEF_(0xc00d36d4) -#define MF_E_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d36d5) -#define MF_E_NOT_AVAILABLE _HRESULT_TYPEDEF_(0xc00d36d6) -#define MF_E_NO_CLOCK _HRESULT_TYPEDEF_(0xc00d36d7) -#define MF_S_MULTIPLE_BEGIN _HRESULT_TYPEDEF_(0x000d36d8) -#define MF_E_MULTIPLE_BEGIN _HRESULT_TYPEDEF_(0xc00d36d9) -#define MF_E_MULTIPLE_SUBSCRIBERS _HRESULT_TYPEDEF_(0xc00d36da) -#define MF_E_TIMER_ORPHANED _HRESULT_TYPEDEF_(0xc00d36db) -#define MF_E_STATE_TRANSITION_PENDING _HRESULT_TYPEDEF_(0xc00d36dc) -#define MF_E_UNSUPPORTED_STATE_TRANSITION _HRESULT_TYPEDEF_(0xc00d36dd) -#define MF_E_UNRECOVERABLE_ERROR_OCCURRED _HRESULT_TYPEDEF_(0xc00d36de) -#define MF_E_SAMPLE_HAS_TOO_MANY_BUFFERS _HRESULT_TYPEDEF_(0xc00d36df) -#define MF_E_SAMPLE_NOT_WRITABLE _HRESULT_TYPEDEF_(0xc00d36e0) -#define MF_E_INVALID_KEY _HRESULT_TYPEDEF_(0xc00d36e2) -#define MF_E_BAD_STARTUP_VERSION _HRESULT_TYPEDEF_(0xc00d36e3) -#define MF_E_UNSUPPORTED_CAPTION _HRESULT_TYPEDEF_(0xc00d36e4) -#define MF_E_INVALID_POSITION _HRESULT_TYPEDEF_(0xc00d36e5) -#define MF_E_ATTRIBUTENOTFOUND _HRESULT_TYPEDEF_(0xc00d36e6) -#define MF_E_PROPERTY_TYPE_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d36e7) -#define MF_E_PROPERTY_TYPE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d36e8) -#define MF_E_PROPERTY_EMPTY _HRESULT_TYPEDEF_(0xc00d36e9) -#define MF_E_PROPERTY_NOT_EMPTY _HRESULT_TYPEDEF_(0xc00d36ea) -#define MF_E_PROPERTY_VECTOR_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d36eb) -#define MF_E_PROPERTY_VECTOR_REQUIRED _HRESULT_TYPEDEF_(0xc00d36ec) -#define MF_E_OPERATION_CANCELLED _HRESULT_TYPEDEF_(0xc00d36ed) -#define MF_E_BYTESTREAM_NOT_SEEKABLE _HRESULT_TYPEDEF_(0xc00d36ee) -#define MF_E_DISABLED_IN_SAFEMODE _HRESULT_TYPEDEF_(0xc00d36ef) -#define MF_E_CANNOT_PARSE_BYTESTREAM _HRESULT_TYPEDEF_(0xc00d36f0) -#define MF_E_SOURCERESOLVER_MUTUALLY_EXCLUSIVE_FLAGS _HRESULT_TYPEDEF_(0xc00d36f1) -#define MF_E_MEDIAPROC_WRONGSTATE _HRESULT_TYPEDEF_(0xc00d36f2) -#define MF_E_RT_THROUGHPUT_NOT_AVAILABLE _HRESULT_TYPEDEF_(0xc00d36f3) -#define MF_E_RT_TOO_MANY_CLASSES _HRESULT_TYPEDEF_(0xc00d36f4) -#define MF_E_RT_WOULDBLOCK _HRESULT_TYPEDEF_(0xc00d36f5) -#define MF_E_NO_BITPUMP _HRESULT_TYPEDEF_(0xc00d36f6) -#define MF_E_RT_OUTOFMEMORY _HRESULT_TYPEDEF_(0xc00d36f7) -#define MF_E_RT_WORKQUEUE_CLASS_NOT_SPECIFIED _HRESULT_TYPEDEF_(0xc00d36f8) -#define MF_E_INSUFFICIENT_BUFFER _HRESULT_TYPEDEF_(0xc00d7170) -#define MF_E_CANNOT_CREATE_SINK _HRESULT_TYPEDEF_(0xc00d36fa) -#define MF_E_BYTESTREAM_UNKNOWN_LENGTH _HRESULT_TYPEDEF_(0xc00d36fb) -#define MF_E_SESSION_PAUSEWHILESTOPPED _HRESULT_TYPEDEF_(0xc00d36fc) -#define MF_S_ACTIVATE_REPLACED _HRESULT_TYPEDEF_(0x000d36fd) -#define MF_E_FORMAT_CHANGE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d36fe) -#define MF_E_INVALID_WORKQUEUE _HRESULT_TYPEDEF_(0xc00d36ff) -#define MF_E_DRM_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d3700) -#define MF_E_UNAUTHORIZED _HRESULT_TYPEDEF_(0xc00d3701) -#define MF_E_OUT_OF_RANGE _HRESULT_TYPEDEF_(0xc00d3702) -#define MF_E_INVALID_CODEC_MERIT _HRESULT_TYPEDEF_(0xc00d3703) -#define MF_E_HW_MFT_FAILED_START_STREAMING _HRESULT_TYPEDEF_(0xc00d3704) -#define MF_E_OPERATION_IN_PROGRESS _HRESULT_TYPEDEF_(0xc00d3705) -#define MF_E_HARDWARE_DRM_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d3706) -#define MF_E_DURATION_TOO_LONG _HRESULT_TYPEDEF_(0xc00d3707) -#define MF_E_OPERATION_UNSUPPORTED_AT_D3D_FEATURE_LEVEL _HRESULT_TYPEDEF_(0xc00d3708) -#define MF_E_UNSUPPORTED_MEDIATYPE_AT_D3D_FEATURE_LEVEL _HRESULT_TYPEDEF_(0xc00d3709) - -#define MF_S_ASF_PARSEINPROGRESS _HRESULT_TYPEDEF_(0x400d3a98) -#define MF_E_ASF_PARSINGINCOMPLETE _HRESULT_TYPEDEF_(0xc00d3a98) -#define MF_E_ASF_MISSINGDATA _HRESULT_TYPEDEF_(0xc00d3a99) -#define MF_E_ASF_INVALIDDATA _HRESULT_TYPEDEF_(0xc00d3a9a) -#define MF_E_ASF_OPAQUEPACKET _HRESULT_TYPEDEF_(0xc00d3a9b) -#define MF_E_ASF_NOINDEX _HRESULT_TYPEDEF_(0xc00d3a9c) -#define MF_E_ASF_OUTOFRANGE _HRESULT_TYPEDEF_(0xc00d3a9d) -#define MF_E_ASF_INDEXNOTLOADED _HRESULT_TYPEDEF_(0xc00d3a9e) -#define MF_E_ASF_TOO_MANY_PAYLOADS _HRESULT_TYPEDEF_(0xc00d3a9f) -#define MF_E_ASF_UNSUPPORTED_STREAM_TYPE _HRESULT_TYPEDEF_(0xc00d3aa0) -#define MF_E_ASF_DROPPED_PACKET _HRESULT_TYPEDEF_(0xc00d3aa1) - -#define MF_E_NO_EVENTS_AVAILABLE _HRESULT_TYPEDEF_(0xc00d3e80) -#define MF_E_INVALID_STATE_TRANSITION _HRESULT_TYPEDEF_(0xc00d3e82) -#define MF_E_END_OF_STREAM _HRESULT_TYPEDEF_(0xc00d3e84) -#define MF_E_SHUTDOWN _HRESULT_TYPEDEF_(0xc00d3e85) -#define MF_E_MP3_NOTFOUND _HRESULT_TYPEDEF_(0xc00d3e86) -#define MF_E_MP3_OUTOFDATA _HRESULT_TYPEDEF_(0xc00d3e87) -#define MF_E_MP3_NOTMP3 _HRESULT_TYPEDEF_(0xc00d3e88) -#define MF_E_MP3_NOTSUPPORTED _HRESULT_TYPEDEF_(0xc00d3e89) -#define MF_E_NO_DURATION _HRESULT_TYPEDEF_(0xc00d3e8a) -#define MF_E_INVALID_FORMAT _HRESULT_TYPEDEF_(0xc00d3e8c) -#define MF_E_PROPERTY_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d3e8d) -#define MF_E_PROPERTY_READ_ONLY _HRESULT_TYPEDEF_(0xc00d3e8e) -#define MF_E_PROPERTY_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d3e8f) -#define MF_E_MEDIA_SOURCE_NOT_STARTED _HRESULT_TYPEDEF_(0xc00d3e91) -#define MF_E_UNSUPPORTED_FORMAT _HRESULT_TYPEDEF_(0xc00d3e98) -#define MF_E_MP3_BAD_CRC _HRESULT_TYPEDEF_(0xc00d3e99) -#define MF_E_NOT_PROTECTED _HRESULT_TYPEDEF_(0xc00d3e9a) -#define MF_E_MEDIA_SOURCE_WRONGSTATE _HRESULT_TYPEDEF_(0xc00d3e9b) -#define MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED _HRESULT_TYPEDEF_(0xc00d3e9c) -#define MF_E_CANNOT_FIND_KEYFRAME_SAMPLE _HRESULT_TYPEDEF_(0xc00d3e9d) -#define MF_E_UNSUPPORTED_CHARACTERISTICS _HRESULT_TYPEDEF_(0xc00d3e9e) -#define MF_E_NO_AUDIO_RECORDING_DEVICE _HRESULT_TYPEDEF_(0xc00d3e9f) -#define MF_E_AUDIO_RECORDING_DEVICE_IN_USE _HRESULT_TYPEDEF_(0xc00d3ea0) -#define MF_E_AUDIO_RECORDING_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d3ea1) -#define MF_E_VIDEO_RECORDING_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d3ea2) -#define MF_E_VIDEO_RECORDING_DEVICE_PREEMPTED _HRESULT_TYPEDEF_(0xc00d3ea3) - -#define MF_E_NETWORK_RESOURCE_FAILURE _HRESULT_TYPEDEF_(0xc00d4268) -#define MF_E_NET_WRITE _HRESULT_TYPEDEF_(0xc00d4269) -#define MF_E_NET_READ _HRESULT_TYPEDEF_(0xc00d426a) -#define MF_E_NET_REQUIRE_NETWORK _HRESULT_TYPEDEF_(0xc00d426b) -#define MF_E_NET_REQUIRE_ASYNC _HRESULT_TYPEDEF_(0xc00d426c) -#define MF_E_NET_BWLEVEL_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d426d) -#define MF_E_NET_STREAMGROUPS_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d426e) -#define MF_E_NET_MANUALSS_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d426f) -#define MF_E_NET_INVALID_PRESENTATION_DESCRIPTOR _HRESULT_TYPEDEF_(0xc00d4270) -#define MF_E_NET_CACHESTREAM_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d4271) -#define MF_I_MANUAL_PROXY _HRESULT_TYPEDEF_(0x400d4272) -#define MF_E_NET_REQUIRE_INPUT _HRESULT_TYPEDEF_(0xc00d4274) -#define MF_E_NET_REDIRECT _HRESULT_TYPEDEF_(0xc00d4275) -#define MF_E_NET_REDIRECT_TO_PROXY _HRESULT_TYPEDEF_(0xc00d4276) -#define MF_E_NET_TOO_MANY_REDIRECTS _HRESULT_TYPEDEF_(0xc00d4277) -#define MF_E_NET_TIMEOUT _HRESULT_TYPEDEF_(0xc00d4278) -#define MF_E_NET_CLIENT_CLOSE _HRESULT_TYPEDEF_(0xc00d4279) -#define MF_E_NET_BAD_CONTROL_DATA _HRESULT_TYPEDEF_(0xc00d427a) -#define MF_E_NET_INCOMPATIBLE_SERVER _HRESULT_TYPEDEF_(0xc00d427b) -#define MF_E_NET_UNSAFE_URL _HRESULT_TYPEDEF_(0xc00d427c) -#define MF_E_NET_CACHE_NO_DATA _HRESULT_TYPEDEF_(0xc00d427d) -#define MF_E_NET_EOL _HRESULT_TYPEDEF_(0xc00d427e) -#define MF_E_NET_BAD_REQUEST _HRESULT_TYPEDEF_(0xc00d427f) -#define MF_E_NET_INTERNAL_SERVER_ERROR _HRESULT_TYPEDEF_(0xc00d4280) -#define MF_E_NET_SESSION_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d4281) -#define MF_E_NET_NOCONNECTION _HRESULT_TYPEDEF_(0xc00d4282) -#define MF_E_NET_CONNECTION_FAILURE _HRESULT_TYPEDEF_(0xc00d4283) -#define MF_E_NET_INCOMPATIBLE_PUSHSERVER _HRESULT_TYPEDEF_(0xc00d4284) -#define MF_E_NET_SERVER_ACCESSDENIED _HRESULT_TYPEDEF_(0xc00d4285) -#define MF_E_NET_PROXY_ACCESSDENIED _HRESULT_TYPEDEF_(0xc00d4286) -#define MF_E_NET_CANNOTCONNECT _HRESULT_TYPEDEF_(0xc00d4287) -#define MF_E_NET_INVALID_PUSH_TEMPLATE _HRESULT_TYPEDEF_(0xc00d4288) -#define MF_E_NET_INVALID_PUSH_PUBLISHING_POINT _HRESULT_TYPEDEF_(0xc00d4289) -#define MF_E_NET_BUSY _HRESULT_TYPEDEF_(0xc00d428a) -#define MF_E_NET_RESOURCE_GONE _HRESULT_TYPEDEF_(0xc00d428b) -#define MF_E_NET_ERROR_FROM_PROXY _HRESULT_TYPEDEF_(0xc00d428c) -#define MF_E_NET_PROXY_TIMEOUT _HRESULT_TYPEDEF_(0xc00d428d) -#define MF_E_NET_SERVER_UNAVAILABLE _HRESULT_TYPEDEF_(0xc00d428e) -#define MF_E_NET_TOO_MUCH_DATA _HRESULT_TYPEDEF_(0xc00d428f) -#define MF_E_NET_SESSION_INVALID _HRESULT_TYPEDEF_(0xc00d4290) -#define MF_E_OFFLINE_MODE _HRESULT_TYPEDEF_(0xc00d4291) -#define MF_E_NET_UDP_BLOCKED _HRESULT_TYPEDEF_(0xc00d4292) -#define MF_E_NET_UNSUPPORTED_CONFIGURATION _HRESULT_TYPEDEF_(0xc00d4293) -#define MF_E_NET_PROTOCOL_DISABLED _HRESULT_TYPEDEF_(0xc00d4294) -#define MF_E_NET_COMPANION_DRIVER_DISCONNECT _HRESULT_TYPEDEF_(0xc00d4295) - -#define MF_E_ALREADY_INITIALIZED _HRESULT_TYPEDEF_(0xc00d4650) -#define MF_E_BANDWIDTH_OVERRUN _HRESULT_TYPEDEF_(0xc00d4651) -#define MF_E_LATE_SAMPLE _HRESULT_TYPEDEF_(0xc00d4652) -#define MF_E_FLUSH_NEEDED _HRESULT_TYPEDEF_(0xc00d4653) -#define MF_E_INVALID_PROFILE _HRESULT_TYPEDEF_(0xc00d4654) -#define MF_E_INDEX_NOT_COMMITTED _HRESULT_TYPEDEF_(0xc00d4655) -#define MF_E_NO_INDEX _HRESULT_TYPEDEF_(0xc00d4656) -#define MF_E_CANNOT_INDEX_IN_PLACE _HRESULT_TYPEDEF_(0xc00d4657) -#define MF_E_MISSING_ASF_LEAKYBUCKET _HRESULT_TYPEDEF_(0xc00d4658) -#define MF_E_INVALID_ASF_STREAMID _HRESULT_TYPEDEF_(0xc00d4659) - -#define MF_E_STREAMSINK_REMOVED _HRESULT_TYPEDEF_(0xc00d4a38) -#define MF_E_STREAMSINKS_OUT_OF_SYNC _HRESULT_TYPEDEF_(0xc00d4a3a) -#define MF_E_STREAMSINKS_FIXED _HRESULT_TYPEDEF_(0xc00d4a3b) -#define MF_E_STREAMSINK_EXISTS _HRESULT_TYPEDEF_(0xc00d4a3c) -#define MF_E_SAMPLEALLOCATOR_CANCELED _HRESULT_TYPEDEF_(0xc00d4a3d) -#define MF_E_SAMPLEALLOCATOR_EMPTY _HRESULT_TYPEDEF_(0xc00d4a3e) -#define MF_E_SINK_ALREADYSTOPPED _HRESULT_TYPEDEF_(0xc00d4a3f) -#define MF_E_ASF_FILESINK_BITRATE_UNKNOWN _HRESULT_TYPEDEF_(0xc00d4a40) -#define MF_E_SINK_NO_STREAMS _HRESULT_TYPEDEF_(0xc00d4a41) -#define MF_S_SINK_NOT_FINALIZED _HRESULT_TYPEDEF_(0x000d4a42) -#define MF_E_METADATA_TOO_LONG _HRESULT_TYPEDEF_(0xc00d4a43) -#define MF_E_SINK_NO_SAMPLES_PROCESSED _HRESULT_TYPEDEF_(0xc00d4a44) -#define MF_E_SINK_HEADERS_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d4a45) - -#define MF_E_VIDEO_REN_NO_PROCAMP_HW _HRESULT_TYPEDEF_(0xc00d4e20) -#define MF_E_VIDEO_REN_NO_DEINTERLACE_HW _HRESULT_TYPEDEF_(0xc00d4e21) -#define MF_E_VIDEO_REN_COPYPROT_FAILED _HRESULT_TYPEDEF_(0xc00d4e22) -#define MF_E_VIDEO_REN_SURFACE_NOT_SHARED _HRESULT_TYPEDEF_(0xc00d4e23) -#define MF_E_VIDEO_DEVICE_LOCKED _HRESULT_TYPEDEF_(0xc00d4e24) -#define MF_E_NEW_VIDEO_DEVICE _HRESULT_TYPEDEF_(0xc00d4e25) -#define MF_E_NO_VIDEO_SAMPLE_AVAILABLE _HRESULT_TYPEDEF_(0xc00d4e26) -#define MF_E_NO_AUDIO_PLAYBACK_DEVICE _HRESULT_TYPEDEF_(0xc00d4e84) -#define MF_E_AUDIO_PLAYBACK_DEVICE_IN_USE _HRESULT_TYPEDEF_(0xc00d4e85) -#define MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d4e86) -#define MF_E_AUDIO_SERVICE_NOT_RUNNING _HRESULT_TYPEDEF_(0xc00d4e87) -#define MF_E_AUDIO_BUFFER_SIZE_ERROR _HRESULT_TYPEDEF_(0xc00d4e88) -#define MF_E_AUDIO_CLIENT_WRAPPER_SPOOF_ERROR _HRESULT_TYPEDEF_(0xc00d4e89) - -#define MF_E_TOPO_INVALID_OPTIONAL_NODE _HRESULT_TYPEDEF_(0xc00d520e) -#define MF_E_TOPO_CANNOT_FIND_DECRYPTOR _HRESULT_TYPEDEF_(0xc00d5211) -#define MF_E_TOPO_CODEC_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d5212) -#define MF_E_TOPO_CANNOT_CONNECT _HRESULT_TYPEDEF_(0xc00d5213) -#define MF_E_TOPO_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d5214) -#define MF_E_TOPO_INVALID_TIME_ATTRIBUTES _HRESULT_TYPEDEF_(0xc00d5215) -#define MF_E_TOPO_LOOPS_IN_TOPOLOGY _HRESULT_TYPEDEF_(0xc00d5216) -#define MF_E_TOPO_MISSING_PRESENTATION_DESCRIPTOR _HRESULT_TYPEDEF_(0xc00d5217) -#define MF_E_TOPO_MISSING_STREAM_DESCRIPTOR _HRESULT_TYPEDEF_(0xc00d5218) -#define MF_E_TOPO_STREAM_DESCRIPTOR_NOT_SELECTED _HRESULT_TYPEDEF_(0xc00d5219) -#define MF_E_TOPO_MISSING_SOURCE _HRESULT_TYPEDEF_(0xc00d521a) -#define MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d521b) - -#define MF_E_SEQUENCER_UNKNOWN_SEGMENT_ID _HRESULT_TYPEDEF_(0xc00d61ac) -#define MF_S_SEQUENCER_CONTEXT_CANCELED _HRESULT_TYPEDEF_(0x000d61ad) -#define MF_E_NO_SOURCE_IN_CACHE _HRESULT_TYPEDEF_(0xc00d61ae) -#define MF_S_SEQUENCER_SEGMENT_AT_END_OF_STREAM _HRESULT_TYPEDEF_(0x000d61af) - -#define MF_E_TRANSFORM_TYPE_NOT_SET _HRESULT_TYPEDEF_(0xc00d6d60) -#define MF_E_TRANSFORM_STREAM_CHANGE _HRESULT_TYPEDEF_(0xc00d6d61) -#define MF_E_TRANSFORM_INPUT_REMAINING _HRESULT_TYPEDEF_(0xc00d6d62) -#define MF_E_TRANSFORM_PROFILE_MISSING _HRESULT_TYPEDEF_(0xc00d6d63) -#define MF_E_TRANSFORM_PROFILE_INVALID_OR_CORRUPT _HRESULT_TYPEDEF_(0xc00d6d64) -#define MF_E_TRANSFORM_PROFILE_TRUNCATED _HRESULT_TYPEDEF_(0xc00d6d65) -#define MF_E_TRANSFORM_PROPERTY_PID_NOT_RECOGNIZED _HRESULT_TYPEDEF_(0xc00d6d66) -#define MF_E_TRANSFORM_PROPERTY_VARIANT_TYPE_WRONG _HRESULT_TYPEDEF_(0xc00d6d67) -#define MF_E_TRANSFORM_PROPERTY_NOT_WRITEABLE _HRESULT_TYPEDEF_(0xc00d6d68) -#define MF_E_TRANSFORM_PROPERTY_ARRAY_VALUE_WRONG_NUM_DIM _HRESULT_TYPEDEF_(0xc00d6d69) -#define MF_E_TRANSFORM_PROPERTY_VALUE_SIZE_WRONG _HRESULT_TYPEDEF_(0xc00d6d6a) -#define MF_E_TRANSFORM_PROPERTY_VALUE_OUT_OF_RANGE _HRESULT_TYPEDEF_(0xc00d6d6b) -#define MF_E_TRANSFORM_PROPERTY_VALUE_INCOMPATIBLE _HRESULT_TYPEDEF_(0xc00d6d6c) -#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_OUTPUT_MEDIATYPE _HRESULT_TYPEDEF_(0xc00d6d6d) -#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_INPUT_MEDIATYPE _HRESULT_TYPEDEF_(0xc00d6d6e) -#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION _HRESULT_TYPEDEF_(0xc00d6d6f) -#define MF_E_TRANSFORM_CONFLICTS_WITH_OTHER_CURRENTLY_ENABLED_FEATURES _HRESULT_TYPEDEF_(0xc00d6d70) -#define MF_E_TRANSFORM_NEED_MORE_INPUT _HRESULT_TYPEDEF_(0xc00d6d72) -#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_SPKR_CONFIG _HRESULT_TYPEDEF_(0xc00d6d73) -#define MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING _HRESULT_TYPEDEF_(0xc00d6d74) -#define MF_S_TRANSFORM_DO_NOT_PROPAGATE_EVENT _HRESULT_TYPEDEF_(0x000d6d75) -#define MF_E_UNSUPPORTED_D3D_TYPE _HRESULT_TYPEDEF_(0xc00d6d76) -#define MF_E_TRANSFORM_ASYNC_LOCKED _HRESULT_TYPEDEF_(0xc00d6d77) -#define MF_E_TRANSFORM_CANNOT_INITIALIZE_ACM_DRIVER _HRESULT_TYPEDEF_(0xc00d6d78) -#define MF_E_TRANSFORM_STREAM_INVALID_RESOLUTION _HRESULT_TYPEDEF_(0xc00d6d79) -#define MF_E_TRANSFORM_ASYNC_MFT_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d6d7a) -#define MF_E_TRANSFORM_EXATTRIBUTE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d6d7c) - -#define MF_E_LICENSE_INCORRECT_RIGHTS _HRESULT_TYPEDEF_(0xc00d7148) -#define MF_E_LICENSE_OUTOFDATE _HRESULT_TYPEDEF_(0xc00d7149) -#define MF_E_LICENSE_REQUIRED _HRESULT_TYPEDEF_(0xc00d714a) -#define MF_E_DRM_HARDWARE_INCONSISTENT _HRESULT_TYPEDEF_(0xc00d714b) -#define MF_E_NO_CONTENT_PROTECTION_MANAGER _HRESULT_TYPEDEF_(0xc00d714c) -#define MF_E_LICENSE_RESTORE_NO_RIGHTS _HRESULT_TYPEDEF_(0xc00d714d) -#define MF_E_BACKUP_RESTRICTED_LICENSE _HRESULT_TYPEDEF_(0xc00d714e) -#define MF_E_LICENSE_RESTORE_NEEDS_INDIVIDUALIZATION _HRESULT_TYPEDEF_(0xc00d714f) -#define MF_S_PROTECTION_NOT_REQUIRED _HRESULT_TYPEDEF_(0x000d7150) -#define MF_E_COMPONENT_REVOKED _HRESULT_TYPEDEF_(0xc00d7151) -#define MF_E_TRUST_DISABLED _HRESULT_TYPEDEF_(0xc00d7152) -#define MF_E_WMDRMOTA_NO_ACTION _HRESULT_TYPEDEF_(0xc00d7153) -#define MF_E_WMDRMOTA_ACTION_ALREADY_SET _HRESULT_TYPEDEF_(0xc00d7154) -#define MF_E_WMDRMOTA_DRM_HEADER_NOT_AVAILABLE _HRESULT_TYPEDEF_(0xc00d7155) -#define MF_E_WMDRMOTA_DRM_ENCRYPTION_SCHEME_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d7156) -#define MF_E_WMDRMOTA_ACTION_MISMATCH _HRESULT_TYPEDEF_(0xc00d7157) -#define MF_E_WMDRMOTA_INVALID_POLICY _HRESULT_TYPEDEF_(0xc00d7158) -#define MF_E_POLICY_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d7159) -#define MF_E_OPL_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d715a) -#define MF_E_TOPOLOGY_VERIFICATION_FAILED _HRESULT_TYPEDEF_(0xc00d715b) -#define MF_E_SIGNATURE_VERIFICATION_FAILED _HRESULT_TYPEDEF_(0xc00d715c) -#define MF_E_DEBUGGING_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d715d) -#define MF_E_CODE_EXPIRED _HRESULT_TYPEDEF_(0xc00d715e) -#define MF_E_GRL_VERSION_TOO_LOW _HRESULT_TYPEDEF_(0xc00d715f) -#define MF_E_GRL_RENEWAL_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d7160) -#define MF_E_GRL_EXTENSIBLE_ENTRY_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d7161) -#define MF_E_KERNEL_UNTRUSTED _HRESULT_TYPEDEF_(0xc00d7162) -#define MF_E_PEAUTH_UNTRUSTED _HRESULT_TYPEDEF_(0xc00d7163) -#define MF_E_NON_PE_PROCESS _HRESULT_TYPEDEF_(0xc00d7165) -#define MF_E_REBOOT_REQUIRED _HRESULT_TYPEDEF_(0xc00d7167) -#define MF_S_WAIT_FOR_POLICY_SET _HRESULT_TYPEDEF_(0x000d7168) -#define MF_S_VIDEO_DISABLED_WITH_UNKNOWN_SOFTWARE_OUTPUT _HRESULT_TYPEDEF_(0x000d7169) -#define MF_E_GRL_INVALID_FORMAT _HRESULT_TYPEDEF_(0xc00d716a) -#define MF_E_GRL_UNRECOGNIZED_FORMAT _HRESULT_TYPEDEF_(0xc00d716b) -#define MF_E_ALL_PROCESS_RESTART_REQUIRED _HRESULT_TYPEDEF_(0xc00d716c) -#define MF_E_PROCESS_RESTART_REQUIRED _HRESULT_TYPEDEF_(0xc00d716d) -#define MF_E_USERMODE_UNTRUSTED _HRESULT_TYPEDEF_(0xc00d716e) -#define MF_E_PEAUTH_SESSION_NOT_STARTED _HRESULT_TYPEDEF_(0xc00d716f) -#define MF_E_PEAUTH_PUBLICKEY_REVOKED _HRESULT_TYPEDEF_(0xc00d7171) -#define MF_E_GRL_ABSENT _HRESULT_TYPEDEF_(0xc00d7172) -#define MF_S_PE_TRUSTED _HRESULT_TYPEDEF_(0x000d7173) -#define MF_E_PE_UNTRUSTED _HRESULT_TYPEDEF_(0xc00d7174) -#define MF_E_PEAUTH_NOT_STARTED _HRESULT_TYPEDEF_(0xc00d7175) -#define MF_E_INCOMPATIBLE_SAMPLE_PROTECTION _HRESULT_TYPEDEF_(0xc00d7176) -#define MF_E_PE_SESSIONS_MAXED _HRESULT_TYPEDEF_(0xc00d7177) -#define MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d7178) -#define MF_E_TEST_SIGNED_COMPONENTS_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d7179) -#define MF_E_ITA_UNSUPPORTED_ACTION _HRESULT_TYPEDEF_(0xc00d717a) -#define MF_E_ITA_ERROR_PARSING_SAP_PARAMETERS _HRESULT_TYPEDEF_(0xc00d717b) -#define MF_E_POLICY_MGR_ACTION_OUTOFBOUNDS _HRESULT_TYPEDEF_(0xc00d717c) -#define MF_E_BAD_OPL_STRUCTURE_FORMAT _HRESULT_TYPEDEF_(0xc00d717d) -#define MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_PROTECTION_GUID _HRESULT_TYPEDEF_(0xc00d717e) -#define MF_E_NO_PMP_HOST _HRESULT_TYPEDEF_(0xc00d717f) -#define MF_E_ITA_OPL_DATA_NOT_INITIALIZED _HRESULT_TYPEDEF_(0xc00d7180) -#define MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_OUTPUT _HRESULT_TYPEDEF_(0xc00d7181) -#define MF_E_ITA_UNRECOGNIZED_DIGITAL_VIDEO_OUTPUT _HRESULT_TYPEDEF_(0xc00d7182) -#define MF_E_RESOLUTION_REQUIRES_PMP_CREATION_CALLBACK _HRESULT_TYPEDEF_(0xc00d7183) -#define MF_E_INVALID_AKE_CHANNEL_PARAMETERS _HRESULT_TYPEDEF_(0xc00d7184) -#define MF_E_CONTENT_PROTECTION_SYSTEM_NOT_ENABLED _HRESULT_TYPEDEF_(0xc00d7185) -#define MF_E_UNSUPPORTED_CONTENT_PROTECTION_SYSTEM _HRESULT_TYPEDEF_(0xc00d7186) -#define MF_E_DRM_MIGRATION_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d7187) -#define MF_E_HDCP_AUTHENTICATION_FAILURE _HRESULT_TYPEDEF_(0xc00d7188) -#define MF_E_HDCP_LINK_FAILURE _HRESULT_TYPEDEF_(0xc00d7189) - -#define MF_E_CLOCK_INVALID_CONTINUITY_KEY _HRESULT_TYPEDEF_(0xc00d9c40) -#define MF_E_CLOCK_NO_TIME_SOURCE _HRESULT_TYPEDEF_(0xc00d9c41) -#define MF_E_CLOCK_STATE_ALREADY_SET _HRESULT_TYPEDEF_(0xc00d9c42) -#define MF_E_CLOCK_NOT_SIMPLE _HRESULT_TYPEDEF_(0xc00d9c43) -#define MF_S_CLOCK_STOPPED _HRESULT_TYPEDEF_(0x000d9c44) -#define MF_E_CLOCK_AUDIO_DEVICE_POSITION_UNEXPECTED _HRESULT_TYPEDEF_(0x000d9c45) -#define MF_E_CLOCK_AUDIO_RENDER_POSITION_UNEXPECTED _HRESULT_TYPEDEF_(0x000d9c46) -#define MF_E_CLOCK_AUDIO_RENDER_TIME_UNEXPECTED _HRESULT_TYPEDEF_(0x000d9c47) - -#define MF_E_NO_MORE_DROP_MODES _HRESULT_TYPEDEF_(0xc00da028) -#define MF_E_NO_MORE_QUALITY_LEVELS _HRESULT_TYPEDEF_(0xc00da029) -#define MF_E_DROPTIME_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00da02a) -#define MF_E_QUALITYKNOB_WAIT_LONGER _HRESULT_TYPEDEF_(0xc00da02b) -#define MF_E_QM_INVALIDSTATE _HRESULT_TYPEDEF_(0xc00da02c) - -#define MF_E_TRANSCODE_NO_CONTAINERTYPE _HRESULT_TYPEDEF_(0xc00da410) -#define MF_E_TRANSCODE_PROFILE_NO_MATCHING_STREAMS _HRESULT_TYPEDEF_(0xc00da411) -#define MF_E_TRANSCODE_NO_MATCHING_ENCODER _HRESULT_TYPEDEF_(0xc00da412) -#define MF_E_TRANSCODE_INVALID_PROFILE _HRESULT_TYPEDEF_(0xc00da413) - -#define MF_E_ALLOCATOR_NOT_INITIALIZED _HRESULT_TYPEDEF_(0xc00da7f8) -#define MF_E_ALLOCATOR_NOT_COMMITED _HRESULT_TYPEDEF_(0xc00da7f9) -#define MF_E_ALLOCATOR_ALREADY_COMMITED _HRESULT_TYPEDEF_(0xc00da7fa) -#define MF_E_STREAM_ERROR _HRESULT_TYPEDEF_(0xc00da7fb) -#define MF_E_INVALID_STREAM_STATE _HRESULT_TYPEDEF_(0xc00da7fc) -#define MF_E_HW_STREAM_NOT_CONNECTED _HRESULT_TYPEDEF_(0xc00da7fd) - -#define MF_E_NO_CAPTURE_DEVICES_AVAILABLE _HRESULT_TYPEDEF_(0xc00dabe0) -#define MF_E_CAPTURE_SINK_OUTPUT_NOT_SET _HRESULT_TYPEDEF_(0xc00dabe1) -#define MF_E_CAPTURE_SINK_MIRROR_ERROR _HRESULT_TYPEDEF_(0xc00dabe2) -#define MF_E_CAPTURE_SINK_ROTATE_ERROR _HRESULT_TYPEDEF_(0xc00dabe3) -#define MF_E_CAPTURE_ENGINE_INVALID_OP _HRESULT_TYPEDEF_(0xc00dabe4) -#define MF_E_CAPTURE_ENGINE_ALL_EFFECTS_REMOVED _HRESULT_TYPEDEF_(0xc00dabe5) -#define MF_E_CAPTURE_SOURCE_NO_INDEPENDENT_PHOTO_STREAM_PRESENT _HRESULT_TYPEDEF_(0xc00dabe6) -#define MF_E_CAPTURE_SOURCE_NO_VIDEO_STREAM_PRESENT _HRESULT_TYPEDEF_(0xc00dabe7) -#define MF_E_CAPTURE_SOURCE_NO_AUDIO_STREAM_PRESENT _HRESULT_TYPEDEF_(0xc00dabe8) -#define MF_E_CAPTURE_SOURCE_DEVICE_EXTENDEDPROP_OP_IN_PROGRESS _HRESULT_TYPEDEF_(0xc00dabe9) -#define MF_E_CAPTURE_PROPERTY_SET_DURING_PHOTO _HRESULT_TYPEDEF_(0xc00dabea) -#define MF_E_CAPTURE_NO_SAMPLES_IN_QUEUE _HRESULT_TYPEDEF_(0xc00dabeb) -#define MF_E_HW_ACCELERATED_THUMBNAIL_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00dabec) -#define MF_E_UNSUPPORTED_CAPTURE_DEVICE_PRESENT _HRESULT_TYPEDEF_(0xc00dabed) - -#define MF_E_TIMELINECONTROLLER_UNSUPPORTED_SOURCE_TYPE _HRESULT_TYPEDEF_(0xc00dafc8) -#define MF_E_TIMELINECONTROLLER_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00dafc9) -#define MF_E_TIMELINECONTROLLER_CANNOT_ATTACH _HRESULT_TYPEDEF_(0xc00dafca) - -#define MF_E_MEDIA_EXTENSION_APPSERVICE_CONNECTION_FAILED _HRESULT_TYPEDEF_(0xc00db3b0) -#define MF_E_MEDIA_EXTENSION_APPSERVICE_REQUEST_FAILED _HRESULT_TYPEDEF_(0xc00db3b1) -#define MF_E_MEDIA_EXTENSION_PACKAGE_INTEGRITY_CHECK_FAILED _HRESULT_TYPEDEF_(0xc00db3b2) -#define MF_E_MEDIA_EXTENSION_PACKAGE_LICENSE_INVALID _HRESULT_TYPEDEF_(0xc00db3b3) - -#define MF_INDEX_SIZE_ERR 0x80700001 -#define MF_NOT_FOUND_ERR 0x80700008 -#define MF_NOT_SUPPORTED_ERR 0x80700009 -#define MF_INVALID_STATE_ERR 0x8070000b -#define MF_SYNTAX_ERR 0x8070000c -#define MF_INVALID_ACCESS_ERR 0x8070000f -#define MF_QUOTA_EXCEEDED_ERR 0x80700016 -#define MF_PARSE_ERR 0x80700051 -#define MF_TYPE_ERR 0x80704005 - -#endif /* __WINE_MFERROR_H */ diff --git a/wrappers/to-synch/sdk/include/psdk/restartmanager.h b/wrappers/to-synch/sdk/include/psdk/restartmanager.h deleted file mode 100644 index ca5f9be71b7..00000000000 --- a/wrappers/to-synch/sdk/include/psdk/restartmanager.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 Austin English - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef RESTARTMANAGER_H -#define RESTARTMANAGER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define RM_SESSION_KEY_LEN sizeof(GUID) -#define CCH_RM_SESSION_KEY RM_SESSION_KEY_LEN*2 -#define CCH_RM_MAX_APP_NAME 255 -#define CH_RM_MAX_SVC_NAME 63 -#define RM_INVALID_TS_SESSION -1 -#define RM_INVALID_PROCESS -1 - -typedef enum { - RmUnknownApp = 0, - RmMainWindow = 1, - RmOtherWindow = 2, - RmService = 3, - RmExplorer = 4, - RmConsole = 5, - RmCritical = 1000 -} RM_APP_TYPE; - -typedef enum _RM_REBOOT_REASON { - RmRebootReasonNone = 0x0000, - RmRebootReasonPermissionDenied = 0x0001, - RmRebootReasonSessionMismatch = 0x0002, - RmRebootReasonCriticalProcess = 0x0004, - RmRebootReasonCriticalService = 0x0008, - RmRebootReasonDetectedSelf = 0x0010 -} RM_REBOOT_REASON; - -typedef enum _RM_FILTER_ACTION { - RmInvalidFilterAction = 0x0000, - RmNoRestart = 0x0001, - RmNoShutdown = 0x0002 -} RM_FILTER_ACTION; - -typedef struct { - DWORD dwProcessId; - FILETIME ProcessStartTime; -} RM_UNIQUE_PROCESS, *PRM_UNIQUE_PROCESS; - -typedef struct { - RM_UNIQUE_PROCESS Process; - WCHAR strAppName[CCH_RM_MAX_APP_NAME+1]; - WCHAR strServiceShortName[CH_RM_MAX_SVC_NAME+1]; - RM_APP_TYPE ApplicationType; - ULONG AppStatus; - DWORD TSSessionID; - BOOL bRestartable; -} RM_PROCESS_INFO, *PRM_PROCESS_INFO; - -typedef void (CDECL *RM_WRITE_STATUS_CALLBACK)(UINT); - -#ifdef __cplusplus -} -#endif - -#endif /* RESTARTMANAGER_H */ diff --git a/wrappers/to-synch/sdk/include/psdk/shellscalingapi.h b/wrappers/to-synch/sdk/include/psdk/shellscalingapi.h deleted file mode 100644 index 4689d83e7d9..00000000000 --- a/wrappers/to-synch/sdk/include/psdk/shellscalingapi.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2016 Sebastian Lackner - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_SHELLSCALINGAPI_H -#define __WINE_SHELLSCALINGAPI_H - -#include - -typedef enum MONITOR_DPI_TYPE -{ - MDT_EFFECTIVE_DPI = 0, - MDT_ANGULAR_DPI = 1, - MDT_RAW_DPI = 2, - MDT_DEFAULT = MDT_EFFECTIVE_DPI, -} MONITOR_DPI_TYPE; - -typedef enum PROCESS_DPI_AWARENESS -{ - PROCESS_DPI_UNAWARE, - PROCESS_SYSTEM_DPI_AWARE, - PROCESS_PER_MONITOR_DPI_AWARE -} PROCESS_DPI_AWARENESS; - -typedef enum -{ - DEVICE_PRIMARY = 0, - DEVICE_IMMERSIVE = 1, -} DISPLAY_DEVICE_TYPE; - -HRESULT WINAPI GetDpiForMonitor(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); -HRESULT WINAPI GetProcessDpiAwareness(HANDLE,PROCESS_DPI_AWARENESS*); -DEVICE_SCALE_FACTOR WINAPI GetScaleFactorForDevice(DISPLAY_DEVICE_TYPE device_type); -HRESULT WINAPI GetScaleFactorForMonitor(HMONITOR,DEVICE_SCALE_FACTOR*); -HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS); - -#endif /* __WINE_SHELLSCALINGAPI_H */ diff --git a/wrappers/to-synch/sdk/include/psdk/uiautomationcoreapi.h b/wrappers/to-synch/sdk/include/psdk/uiautomationcoreapi.h deleted file mode 100644 index de486710158..00000000000 --- a/wrappers/to-synch/sdk/include/psdk/uiautomationcoreapi.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012 Jacek Caban for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef _INC_UIAUTOMATIONCOREAPI -#define _INC_UIAUTOMATIONCOREAPI - -#ifdef __cplusplus -extern "C" { -#endif - -#define UIA_E_ELEMENTNOTENABLED 0x80040200 -#define UIA_E_ELEMENTNOTAVAILABLE 0x80040201 -#define UIA_E_NOCLICKABLEPOINT 0x80040202 -#define UIA_E_PROXYASSEMBLYNOTLOADED 0x80040203 -#define UIA_E_NOTSUPPORTED 0x80040204 -#define UIA_E_INVALIDOPERATION 0x80131509 -#define UIA_E_TIMEOUT 0x80131505 - -#define UiaAppendRuntimeId 3 -#define UiaRootObjectId -25 - -DECLARE_HANDLE(HUIANODE); -DECLARE_HANDLE(HUIAPATTERNOBJECT); -DECLARE_HANDLE(HUIATEXTRANGE); -DECLARE_HANDLE(HUIAEVENT); - -enum AutomationIdentifierType -{ - AutomationIdentifierType_Property, - AutomationIdentifierType_Pattern, - AutomationIdentifierType_Event, - AutomationIdentifierType_ControlType, - AutomationIdentifierType_TextAttribute, - AutomationIdentifierType_LandmarkType, - AutomationIdentifierType_Annotation, - AutomationIdentifierType_Changes, - AutomationIdentifierType_Style -}; - -enum ProviderType -{ - ProviderType_BaseHwnd, - ProviderType_Proxy, - ProviderType_NonClientArea, -}; - -typedef SAFEARRAY * WINAPI UiaProviderCallback(HWND hwnd,enum ProviderType providerType); - -HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value); -HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value); -int WINAPI UiaLookupId(enum AutomationIdentifierType type, const GUID *guid); -BOOL WINAPI UiaPatternRelease(HUIAPATTERNOBJECT hobj); -HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple *provider, EVENTID id); -void WINAPI UiaRegisterProviderCallback(UiaProviderCallback *pCallback); -LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *elprov); -BOOL WINAPI UiaTextRangeRelease(HUIATEXTRANGE hobj); -HRESULT WINAPI UiaHostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **elprov); - -#ifdef __cplusplus -} -#endif - -#endif /* _INC_UIAUTOMATIONCOREAPI */ diff --git a/wrappers/to-synch/sdk/include/reactos/wine/CMakeLists.txt b/wrappers/to-synch/sdk/include/reactos/wine/CMakeLists.txt deleted file mode 100644 index ba6ea5ee363..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ - -add_idl_headers(wineheaders - fil_data.idl - itss.idl - evr.idl - orpc.idl - rtworkq.idl - d3d10.idl - d3d10_1.idl - d3d10sdklayers.idl - d3d11sdklayers.idl - d3d11.idl - dxgi.idl - dxgitype.idl - dxgicommon.idl - mfmediaengine.idl - mfplay.idl - mfreadwrite.idl - schrpc.idl - ) diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d10.idl b/wrappers/to-synch/sdk/include/reactos/wine/d3d10.idl deleted file mode 100644 index c35e44a0d92..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d10.idl +++ /dev/null @@ -1,1649 +0,0 @@ -/* - * Copyright 2007 Andras Kovacs - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgi.idl"; -import "d3dcommon.idl"; - -cpp_quote("#ifndef _D3D10_CONSTANTS") -cpp_quote("#define _D3D10_CONSTANTS") -const float D3D10_DEFAULT_BLEND_FACTOR_ALPHA = 1.0; -const float D3D10_DEFAULT_BLEND_FACTOR_BLUE = 1.0; -const float D3D10_DEFAULT_BLEND_FACTOR_GREEN = 1.0; -const float D3D10_DEFAULT_BLEND_FACTOR_RED = 1.0; -const float D3D10_DEFAULT_BORDER_COLOR_COMPONENT = 0.0; -const float D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS = 0.0; -const float D3D10_DEFAULT_DEPTH_BIAS_CLAMP = 0.0; -const float D3D10_DEFAULT_MAX_ANISOTROPY = 16.0; -const float D3D10_DEFAULT_MIP_LOD_BIAS = 0.0; -const float D3D10_DEFAULT_VIEWPORT_MAX_DEPTH = 0.0; -const float D3D10_DEFAULT_VIEWPORT_MIN_DEPTH = 0.0; -const float D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP = 0.6; -const float D3D10_FLOAT32_MAX = 3.402823466e+38; -const float D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP = 0.6; -const float D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR = 2.4; -const float D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR = 1.0; -const float D3D10_FLOAT_TO_SRGB_OFFSET = 0.055; -const float D3D10_FLOAT_TO_SRGB_SCALE_1 = 12.92; -const float D3D10_FLOAT_TO_SRGB_SCALE_2 = 1.055; -const float D3D10_FLOAT_TO_SRGB_THRESHOLD = 0.0031308; -const float D3D10_FTOI_INSTRUCTION_MAX_INPUT = 2147483647.999; -const float D3D10_FTOI_INSTRUCTION_MIN_INPUT = -2147483648.999; -const float D3D10_FTOU_INSTRUCTION_MAX_INPUT = 4294967295.999; -const float D3D10_FTOU_INSTRUCTION_MIN_INPUT = 0.0; -const float D3D10_LINEAR_GAMMA = 1.0; -const float D3D10_MAX_BORDER_COLOR_COMPONENT = 1.0; -const float D3D10_MAX_DEPTH = 1.0; -const float D3D10_MAX_POSITION_VALUE = 3.402823466e+34; -const float D3D10_MIN_BORDER_COLOR_COMPONENT = 0.0; -const float D3D10_MIN_DEPTH = 0.0; -const float D3D10_MIP_LOD_BIAS_MAX = 15.99; -const float D3D10_MIP_LOD_BIAS_MIN = -16.0; -const float D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT = 0.5; -const float D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH = 1.4; -const float D3D10_SRGB_GAMMA = 2.2; -const float D3D10_SRGB_TO_FLOAT_DENOMINATOR_1 = 12.92; -const float D3D10_SRGB_TO_FLOAT_DENOMINATOR_2 = 1.055; -const float D3D10_SRGB_TO_FLOAT_EXPONENT = 2.4; -const float D3D10_SRGB_TO_FLOAT_OFFSET = 0.055; -const float D3D10_SRGB_TO_FLOAT_THRESHOLD = 0.04045; -const float D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP = 0.5; -const float D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT = 0.0; -const float D3D_SPEC_VERSION = 1.050005; -const unsigned int D3D10_16BIT_INDEX_STRIP_CUT_VALUE = 0xffff; -const unsigned int D3D10_32BIT_INDEX_STRIP_CUT_VALUE = 0xffffffff; -const unsigned int D3D10_8BIT_INDEX_STRIP_CUT_VALUE = 0xff; -const unsigned int D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT = 9; -const unsigned int D3D10_CLIP_OR_CULL_DISTANCE_COUNT = 8; -const unsigned int D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT = 2; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = 14; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = 4; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT = 15; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = 15; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; -const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT = 64; -const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT = 1; -const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; -const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS = 1; -const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT = 128; -const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST = 1; -const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = 128; -const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS = 1; -const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT = 16; -const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST = 1; -const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT = 16; -const unsigned int D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT = 32; -const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COUNT = 4096; -const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST = 3; -const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS = 3; -const unsigned int D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX = 10; -const int D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN = -10; -const int D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE = -8; -const unsigned int D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE = 7; -const unsigned int D3D10_DEFAULT_DEPTH_BIAS = 0; -const unsigned int D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX = 0; -const unsigned int D3D10_DEFAULT_SAMPLE_MASK = 0xffffffff; -const unsigned int D3D10_DEFAULT_SCISSOR_ENDX = 0; -const unsigned int D3D10_DEFAULT_SCISSOR_ENDY = 0; -const unsigned int D3D10_DEFAULT_SCISSOR_STARTX = 0; -const unsigned int D3D10_DEFAULT_SCISSOR_STARTY = 0; -const unsigned int D3D10_DEFAULT_STENCIL_READ_MASK = 0xff; -const unsigned int D3D10_DEFAULT_STENCIL_REFERENCE = 0; -const unsigned int D3D10_DEFAULT_STENCIL_WRITE_MASK = 0xff; -const unsigned int D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX = 0; -const unsigned int D3D10_DEFAULT_VIEWPORT_HEIGHT = 0; -const unsigned int D3D10_DEFAULT_VIEWPORT_TOPLEFTX = 0; -const unsigned int D3D10_DEFAULT_VIEWPORT_TOPLEFTY = 0; -const unsigned int D3D10_DEFAULT_VIEWPORT_WIDTH = 0; -const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS = 1; -const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT = 1; -const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST = 2; -const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_GS_INPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT =32; -const unsigned int D3D10_GS_INPUT_REGISTER_COUNT = 16; -const unsigned int D3D10_GS_INPUT_REGISTER_READS_PER_INST = 2; -const unsigned int D3D10_GS_INPUT_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_GS_INPUT_REGISTER_VERTICES = 6; -const unsigned int D3D10_GS_OUTPUT_ELEMENTS = 32; -const unsigned int D3D10_GS_OUTPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_GS_OUTPUT_REGISTER_COUNT = 32; -const unsigned int D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES = 0; -const unsigned int D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY = 0; -const unsigned int D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES = 0; -const unsigned int D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT = 1; -const unsigned int D3D10_IA_INSTANCE_ID_BIT_COUNT = 32; -const unsigned int D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT = 32; -const unsigned int D3D10_IA_PRIMITIVE_ID_BIT_COUNT = 32; -const unsigned int D3D10_IA_VERTEX_ID_BIT_COUNT = 32; -const unsigned int D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 16; -const unsigned int D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = 64; -const unsigned int D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = 16; -const unsigned int D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT = 0xffffffff; -const unsigned int D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER = 0xffffffff; -const unsigned int D3D10_MAX_MAXANISOTROPY = 16; -const unsigned int D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT = 32; -const unsigned int D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP = 17; -const unsigned int D3D10_MIN_MAXANISOTROPY = 0; -const unsigned int D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT = 6; -const unsigned int D3D10_MIP_LOD_RANGE_BIT_COUNT = 8; -const unsigned int D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT = 0; -const unsigned int D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT = 13; -const unsigned int D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT = 15; -const unsigned int D3D10_PS_FRONTFACING_DEFAULT_VALUE = 0xffffffff; -const unsigned int D3D10_PS_FRONTFACING_FALSE_VALUE = 0; -const unsigned int D3D10_PS_FRONTFACING_TRUE_VALUE = 0xffffffff; -const unsigned int D3D10_PS_INPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_PS_INPUT_REGISTER_COUNT = 32; -const unsigned int D3D10_PS_INPUT_REGISTER_READS_PER_INST = 2; -const unsigned int D3D10_PS_INPUT_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS = 1; -const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT = 1; -const unsigned int D3D10_PS_OUTPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_PS_OUTPUT_REGISTER_COUNT = 8; -const unsigned int D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT = 4096; -const unsigned int D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP = 27; -const unsigned int D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; -const unsigned int D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT = 4096; -const unsigned int D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 32; -const unsigned int D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP = 32; -const unsigned int D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION = 8192; -const unsigned int D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT = 1024; -const unsigned int D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; -const unsigned int D3D10_REQ_MAXANISOTROPY = 16; -const unsigned int D3D10_REQ_MIP_LEVELS = 14; -const unsigned int D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES = 2048; -const unsigned int D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT = 4096; -const unsigned int D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH = 8192; -const unsigned int D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES = 128; -const unsigned int D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP = 20; -const unsigned int D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT = 4096; -const unsigned int D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = 512; -const unsigned int D3D10_REQ_TEXTURE1D_U_DIMENSION = 8192; -const unsigned int D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = 512; -const unsigned int D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION = 8192; -const unsigned int D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048; -const unsigned int D3D10_REQ_TEXTURECUBE_DIMENSION = 8192; -const unsigned int D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = 0; -const unsigned int D3D10_SHADER_MAJOR_VERSION = 4; -const unsigned int D3D10_SHADER_MINOR_VERSION = 0; -const unsigned int D3D10_SHIFT_INSTRUCTION_PAD_VALUE = 0; -const unsigned int D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT = 5; -const unsigned int D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; -const unsigned int D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048; -const unsigned int D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 256; -const unsigned int D3D10_SO_BUFFER_SLOT_COUNT = 4; -const unsigned int D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP = 0xffffffff; -const unsigned int D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER = 1; -const unsigned int D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT = 64; -const unsigned int D3D10_STANDARD_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED = 64; -const unsigned int D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = 4; -const unsigned int D3D10_STANDARD_PIXEL_COMPONENT_COUNT = 128; -const unsigned int D3D10_STANDARD_PIXEL_ELEMENT_COUNT = 32; -const unsigned int D3D10_STANDARD_VECTOR_SIZE = 4; -const unsigned int D3D10_STANDARD_VERTEX_ELEMENT_COUNT = 16; -const unsigned int D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = 64; -const unsigned int D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT = 8; -const unsigned int D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT = 6; -const unsigned int D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT = 18; -const unsigned int D3D10_UNBOUND_MEMORY_ACCESS_RESULT = 0; -const unsigned int D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15; -const unsigned int D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16; -const unsigned int D3D10_VIEWPORT_BOUNDS_MAX = 16383; -const int D3D10_VIEWPORT_BOUNDS_MIN = -16384; -const unsigned int D3D10_VS_INPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_VS_INPUT_REGISTER_COUNT = 16; -const unsigned int D3D10_VS_INPUT_REGISTER_READS_PER_INST = 2; -const unsigned int D3D10_VS_INPUT_REGISTER_READ_PORTS = 1; -const unsigned int D3D10_VS_OUTPUT_REGISTER_COMPONENTS = 4; -const unsigned int D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const unsigned int D3D10_VS_OUTPUT_REGISTER_COUNT = 16; -const unsigned int D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT = 10; -const unsigned int D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 25; -const unsigned int D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP = 25; -const unsigned int D3D_MAJOR_VERSION = 10; -const unsigned int D3D_MINOR_VERSION = 0; -const unsigned int D3D_SPEC_DATE_DAY = 8; -const unsigned int D3D_SPEC_DATE_MONTH = 8; -const unsigned int D3D_SPEC_DATE_YEAR = 2006; -cpp_quote("#endif") - -const unsigned int D3D10_APPEND_ALIGNED_ELEMENT = 0xffffffff; -const unsigned int _FACD3D10 = 0x879; -const unsigned int _FACD3D10DEBUG = _FACD3D10 + 1; -const unsigned int D3D10_FILTER_TYPE_MASK = 0x3; -const unsigned int D3D10_SDK_VERSION = 29; - -cpp_quote("#define MAKE_D3D10_HRESULT(code) MAKE_HRESULT( 1, _FACD3D10, code)") -cpp_quote("#define MAKE_D3D10_STATUS(code) MAKE_HRESULT( 0, _FACD3D10, code)") -cpp_quote("#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D10_HRESULT(1)") -cpp_quote("#define D3D10_ERROR_FILE_NOT_FOUND MAKE_D3D10_HRESULT(2)") - -typedef enum D3D10_BLEND { - D3D10_BLEND_ZERO = 1, - D3D10_BLEND_ONE = 2, - D3D10_BLEND_SRC_COLOR = 3, - D3D10_BLEND_INV_SRC_COLOR = 4, - D3D10_BLEND_SRC_ALPHA = 5, - D3D10_BLEND_INV_SRC_ALPHA = 6, - D3D10_BLEND_DEST_ALPHA = 7, - D3D10_BLEND_INV_DEST_ALPHA = 8, - D3D10_BLEND_DEST_COLOR = 9, - D3D10_BLEND_INV_DEST_COLOR = 10, - D3D10_BLEND_SRC_ALPHA_SAT = 11, - D3D10_BLEND_BLEND_FACTOR = 14, - D3D10_BLEND_INV_BLEND_FACTOR = 15, - D3D10_BLEND_SRC1_COLOR = 16, - D3D10_BLEND_INV_SRC1_COLOR = 17, - D3D10_BLEND_SRC1_ALPHA = 18, - D3D10_BLEND_INV_SRC1_ALPHA = 19 -} D3D10_BLEND; - -typedef enum D3D10_BLEND_OP { - D3D10_BLEND_OP_ADD = 1, - D3D10_BLEND_OP_SUBTRACT, - D3D10_BLEND_OP_REV_SUBTRACT, - D3D10_BLEND_OP_MIN, - D3D10_BLEND_OP_MAX, -} D3D10_BLEND_OP; - -typedef struct D3D10_BLEND_DESC { - BOOL AlphaToCoverageEnable; - BOOL BlendEnable[8]; - D3D10_BLEND SrcBlend; - D3D10_BLEND DestBlend; - D3D10_BLEND_OP BlendOp; - D3D10_BLEND SrcBlendAlpha; - D3D10_BLEND DestBlendAlpha; - D3D10_BLEND_OP BlendOpAlpha; - UINT8 RenderTargetWriteMask[8]; -} D3D10_BLEND_DESC; - -typedef enum D3D10_DEPTH_WRITE_MASK { - D3D10_DEPTH_WRITE_MASK_ZERO, - D3D10_DEPTH_WRITE_MASK_ALL, -} D3D10_DEPTH_WRITE_MASK; - -typedef enum D3D10_COMPARISON_FUNC { - D3D10_COMPARISON_NEVER = 1, - D3D10_COMPARISON_LESS, - D3D10_COMPARISON_EQUAL, - D3D10_COMPARISON_LESS_EQUAL, - D3D10_COMPARISON_GREATER, - D3D10_COMPARISON_NOT_EQUAL, - D3D10_COMPARISON_GREATER_EQUAL, - D3D10_COMPARISON_ALWAYS, -} D3D10_COMPARISON_FUNC; - -typedef enum D3D10_STENCIL_OP { - D3D10_STENCIL_OP_KEEP = 1, - D3D10_STENCIL_OP_ZERO, - D3D10_STENCIL_OP_REPLACE, - D3D10_STENCIL_OP_INCR_SAT, - D3D10_STENCIL_OP_DECR_SAT, - D3D10_STENCIL_OP_INVERT, - D3D10_STENCIL_OP_INCR, - D3D10_STENCIL_OP_DECR, -} D3D10_STENCIL_OP; - -typedef struct D3D10_DEPTH_STENCILOP_DESC { - D3D10_STENCIL_OP StencilFailOp; - D3D10_STENCIL_OP StencilDepthFailOp; - D3D10_STENCIL_OP StencilPassOp; - D3D10_COMPARISON_FUNC StencilFunc; -} D3D10_DEPTH_STENCILOP_DESC; - -typedef struct D3D10_DEPTH_STENCIL_DESC { - BOOL DepthEnable; - D3D10_DEPTH_WRITE_MASK DepthWriteMask; - D3D10_COMPARISON_FUNC DepthFunc; - BOOL StencilEnable; - UINT8 StencilReadMask; - UINT8 StencilWriteMask; - D3D10_DEPTH_STENCILOP_DESC FrontFace; - D3D10_DEPTH_STENCILOP_DESC BackFace; -} D3D10_DEPTH_STENCIL_DESC; - -typedef enum D3D10_FILL_MODE { - D3D10_FILL_WIREFRAME = 2, - D3D10_FILL_SOLID, -} D3D10_FILL_MODE; - -typedef enum D3D10_CULL_MODE { - D3D10_CULL_NONE = 1, - D3D10_CULL_FRONT, - D3D10_CULL_BACK, -} D3D10_CULL_MODE; - -typedef struct D3D10_RASTERIZER_DESC { - D3D10_FILL_MODE FillMode; - D3D10_CULL_MODE CullMode; - BOOL FrontCounterClockwise; - INT DepthBias; - FLOAT DepthBiasClamp; - FLOAT SlopeScaledDepthBias; - BOOL DepthClipEnable; - BOOL ScissorEnable; - BOOL MultisampleEnable; - BOOL AntialiasedLineEnable; -} D3D10_RASTERIZER_DESC; - -typedef enum D3D10_FILTER { - D3D10_FILTER_MIN_MAG_MIP_POINT = 0, - D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, - D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, - D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, - D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, - D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, - D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, - D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15, - D3D10_FILTER_ANISOTROPIC = 0x55, - D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, - D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, - D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, - D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, - D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, - D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, - D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, - D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, - D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5, - D3D10_FILTER_TEXT_1BIT = 0x80000000 -} D3D10_FILTER; - -typedef enum D3D10_TEXTURE_ADDRESS_MODE { - D3D10_TEXTURE_ADDRESS_WRAP = 1, - D3D10_TEXTURE_ADDRESS_MIRROR, - D3D10_TEXTURE_ADDRESS_CLAMP, - D3D10_TEXTURE_ADDRESS_BORDER, - D3D10_TEXTURE_ADDRESS_MIRROR_ONCE, -} D3D10_TEXTURE_ADDRESS_MODE; - -typedef struct D3D10_SAMPLER_DESC { - D3D10_FILTER Filter; - D3D10_TEXTURE_ADDRESS_MODE AddressU; - D3D10_TEXTURE_ADDRESS_MODE AddressV; - D3D10_TEXTURE_ADDRESS_MODE AddressW; - FLOAT MipLODBias; - UINT MaxAnisotropy; - D3D10_COMPARISON_FUNC ComparisonFunc; - FLOAT BorderColor[4]; - FLOAT MinLOD; - FLOAT MaxLOD; -} D3D10_SAMPLER_DESC; - -typedef enum D3D10_COUNTER { - D3D10_COUNTER_GPU_IDLE, - D3D10_COUNTER_VERTEX_PROCESSING, - D3D10_COUNTER_GEOMETRY_PROCESSING, - D3D10_COUNTER_PIXEL_PROCESSING, - D3D10_COUNTER_OTHER_GPU_PROCESSING, - D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION, - D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION, - D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION, - D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION, - D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION, - D3D10_COUNTER_VS_MEMORY_LIMITED, - D3D10_COUNTER_VS_COMPUTATION_LIMITED, - D3D10_COUNTER_GS_MEMORY_LIMITED, - D3D10_COUNTER_GS_COMPUTATION_LIMITED, - D3D10_COUNTER_PS_MEMORY_LIMITED, - D3D10_COUNTER_PS_COMPUTATION_LIMITED, - D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE, - D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE, - D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000 -} D3D10_COUNTER; - -typedef struct D3D10_COUNTER_DESC { - D3D10_COUNTER Counter; - UINT MiscFlags; -} D3D10_COUNTER_DESC; - -typedef enum D3D10_COUNTER_TYPE { - D3D10_COUNTER_TYPE_FLOAT32, - D3D10_COUNTER_TYPE_UINT16, - D3D10_COUNTER_TYPE_UINT32, - D3D10_COUNTER_TYPE_UINT64, -} D3D10_COUNTER_TYPE; - -typedef struct D3D10_COUNTER_INFO { - D3D10_COUNTER LastDeviceDependentCounter; - UINT NumSimultaneousCounters; - UINT8 NumDetectableParallelUnits; -} D3D10_COUNTER_INFO; - -typedef enum D3D10_RESOURCE_DIMENSION { - D3D10_RESOURCE_DIMENSION_UNKNOWN, - D3D10_RESOURCE_DIMENSION_BUFFER, - D3D10_RESOURCE_DIMENSION_TEXTURE1D, - D3D10_RESOURCE_DIMENSION_TEXTURE2D, - D3D10_RESOURCE_DIMENSION_TEXTURE3D, -} D3D10_RESOURCE_DIMENSION; - -typedef enum D3D10_USAGE { - D3D10_USAGE_DEFAULT, - D3D10_USAGE_IMMUTABLE, - D3D10_USAGE_DYNAMIC, - D3D10_USAGE_STAGING, -} D3D10_USAGE; - -typedef enum D3D10_BIND_FLAG { - D3D10_BIND_VERTEX_BUFFER = 0x1, - D3D10_BIND_INDEX_BUFFER = 0x2, - D3D10_BIND_CONSTANT_BUFFER = 0x4, - D3D10_BIND_SHADER_RESOURCE = 0x8, - D3D10_BIND_STREAM_OUTPUT = 0x10, - D3D10_BIND_RENDER_TARGET = 0x20, - D3D10_BIND_DEPTH_STENCIL = 0x40 -} D3D10_BIND_FLAG; - -typedef struct D3D10_BUFFER_DESC { - UINT ByteWidth; - D3D10_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D10_BUFFER_DESC; - -cpp_quote("#if !defined(D3D10_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D10_BUFFER_DESC : public D3D10_BUFFER_DESC {") -cpp_quote(" CD3D10_BUFFER_DESC() {}" ) -cpp_quote(" explicit CD3D10_BUFFER_DESC(const D3D10_BUFFER_DESC &o) : D3D10_BUFFER_DESC(o) {}") -cpp_quote(" explicit CD3D10_BUFFER_DESC(UINT byteWidth, UINT bindFlags, D3D10_USAGE usage = D3D10_USAGE_DEFAULT, UINT cpuaccessFlags = 0, UINT miscFlags = 0 ) {") -cpp_quote(" ByteWidth = byteWidth;") -cpp_quote(" Usage = usage;") -cpp_quote(" BindFlags = bindFlags;") -cpp_quote(" CPUAccessFlags = cpuaccessFlags;") -cpp_quote(" MiscFlags = miscFlags;") -cpp_quote(" }") -cpp_quote(" ~CD3D10_BUFFER_DESC() {}") -cpp_quote(" operator const D3D10_BUFFER_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - -typedef enum D3D10_MAP { - D3D10_MAP_READ = 1, - D3D10_MAP_WRITE, - D3D10_MAP_READ_WRITE, - D3D10_MAP_WRITE_DISCARD, - D3D10_MAP_WRITE_NO_OVERWRITE, -} D3D10_MAP; - -typedef struct D3D10_TEXTURE1D_DESC { - UINT Width; - UINT MipLevels; - UINT ArraySize; - DXGI_FORMAT Format; - D3D10_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D10_TEXTURE1D_DESC; - -cpp_quote("#if !defined(D3D10_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D10_TEXTURE1D_DESC : public D3D10_TEXTURE1D_DESC {") -cpp_quote(" CD3D10_TEXTURE1D_DESC() {}") -cpp_quote(" explicit CD3D10_TEXTURE1D_DESC(const D3D10_TEXTURE1D_DESC &o) : D3D10_TEXTURE1D_DESC(o) {}") -cpp_quote(" explicit CD3D10_TEXTURE1D_DESC(DXGI_FORMAT format, UINT width, UINT arraySize = 1, UINT mipLevels = 0,") -cpp_quote(" UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, D3D10_USAGE usage = D3D10_USAGE_DEFAULT, UINT cpuaccessFlags = 0,") -cpp_quote(" UINT miscFlags = 0) {") -cpp_quote(" Width = width;") -cpp_quote(" MipLevels = mipLevels;") -cpp_quote(" ArraySize = arraySize;") -cpp_quote(" Format = format;") -cpp_quote(" Usage = usage;") -cpp_quote(" BindFlags = bindFlags;") -cpp_quote(" CPUAccessFlags = cpuaccessFlags;") -cpp_quote(" MiscFlags = miscFlags;") -cpp_quote(" }") -cpp_quote(" ~CD3D10_TEXTURE1D_DESC() {}") -cpp_quote(" operator const D3D10_TEXTURE1D_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D10_TEXTURE2D_DESC { - UINT Width; - UINT Height; - UINT MipLevels; - UINT ArraySize; - DXGI_FORMAT Format; - DXGI_SAMPLE_DESC SampleDesc; - D3D10_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D10_TEXTURE2D_DESC; - -cpp_quote("#if !defined(D3D10_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D10_TEXTURE2D_DESC : public D3D10_TEXTURE2D_DESC {") -cpp_quote(" CD3D10_TEXTURE2D_DESC() {}" ) -cpp_quote(" explicit CD3D10_TEXTURE2D_DESC(const D3D10_TEXTURE2D_DESC &o) : D3D10_TEXTURE2D_DESC(o) {}") -cpp_quote(" explicit CD3D10_TEXTURE2D_DESC(DXGI_FORMAT format, UINT width, UINT height,") -cpp_quote(" UINT arraySize = 1,") -cpp_quote(" UINT mipLevels = 0,") -cpp_quote(" UINT bindFlags = D3D10_BIND_SHADER_RESOURCE,") -cpp_quote(" D3D10_USAGE usage = D3D10_USAGE_DEFAULT,") -cpp_quote(" UINT cpuaccessFlags = 0,") -cpp_quote(" UINT sampleCount = 1,") -cpp_quote(" UINT sampleQuality = 0,") -cpp_quote(" UINT miscFlags = 0) {") -cpp_quote(" Width = width;" ) -cpp_quote(" Height = height;" ) -cpp_quote(" MipLevels = mipLevels;" ) -cpp_quote(" ArraySize = arraySize;" ) -cpp_quote(" Format = format;" ) -cpp_quote(" SampleDesc.Count = sampleCount;" ) -cpp_quote(" SampleDesc.Quality = sampleQuality;" ) -cpp_quote(" Usage = usage;" ) -cpp_quote(" BindFlags = bindFlags;" ) -cpp_quote(" CPUAccessFlags = cpuaccessFlags;" ) -cpp_quote(" MiscFlags = miscFlags;" ) -cpp_quote(" }") -cpp_quote(" ~CD3D10_TEXTURE2D_DESC() {}") -cpp_quote(" operator const D3D10_TEXTURE2D_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D10_TEXTURE3D_DESC { - UINT Width; - UINT Height; - UINT Depth; - UINT MipLevels; - DXGI_FORMAT Format; - D3D10_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D10_TEXTURE3D_DESC; - -typedef enum D3D10_DSV_DIMENSION -{ - D3D10_DSV_DIMENSION_UNKNOWN, - D3D10_DSV_DIMENSION_TEXTURE1D, - D3D10_DSV_DIMENSION_TEXTURE1DARRAY, - D3D10_DSV_DIMENSION_TEXTURE2D, - D3D10_DSV_DIMENSION_TEXTURE2DARRAY, - D3D10_DSV_DIMENSION_TEXTURE2DMS, - D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY, -} D3D10_DSV_DIMENSION; - -typedef struct D3D10_TEX1D_DSV { - UINT MipSlice; -} D3D10_TEX1D_DSV; - -typedef struct D3D10_TEX1D_ARRAY_DSV { - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX1D_ARRAY_DSV; - -typedef struct D3D10_TEX2D_DSV { - UINT MipSlice; -} D3D10_TEX2D_DSV; - -typedef struct D3D10_TEX2D_ARRAY_DSV { - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2D_ARRAY_DSV; - -typedef struct D3D10_TEX2DMS_DSV { - UINT UnusedField_NothingToDefine; -} D3D10_TEX2DMS_DSV; - -typedef struct D3D10_TEX2DMS_ARRAY_DSV { - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2DMS_ARRAY_DSV; - -typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC { - DXGI_FORMAT Format; - D3D10_DSV_DIMENSION ViewDimension; - union { - D3D10_TEX1D_DSV Texture1D; - D3D10_TEX1D_ARRAY_DSV Texture1DArray; - D3D10_TEX2D_DSV Texture2D; - D3D10_TEX2D_ARRAY_DSV Texture2DArray; - D3D10_TEX2DMS_DSV Texture2DMS; - D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray; - }; -} D3D10_DEPTH_STENCIL_VIEW_DESC; - -typedef enum D3D10_RTV_DIMENSION { - D3D10_RTV_DIMENSION_UNKNOWN, - D3D10_RTV_DIMENSION_BUFFER, - D3D10_RTV_DIMENSION_TEXTURE1D, - D3D10_RTV_DIMENSION_TEXTURE1DARRAY, - D3D10_RTV_DIMENSION_TEXTURE2D, - D3D10_RTV_DIMENSION_TEXTURE2DARRAY, - D3D10_RTV_DIMENSION_TEXTURE2DMS, - D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY, - D3D10_RTV_DIMENSION_TEXTURE3D, -} D3D10_RTV_DIMENSION; - -typedef struct D3D10_BUFFER_RTV { - union { - UINT FirstElement; - UINT ElementOffset; - }; - union { - UINT NumElements; - UINT ElementWidth; - }; -} D3D10_BUFFER_RTV; - -typedef struct D3D10_TEX1D_RTV { - UINT MipSlice; -} D3D10_TEX1D_RTV; - -typedef struct D3D10_TEX1D_ARRAY_RTV { - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX1D_ARRAY_RTV; - -typedef struct D3D10_TEX2D_RTV { - UINT MipSlice; -} D3D10_TEX2D_RTV; - -typedef struct D3D10_TEX2D_ARRAY_RTV { - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2D_ARRAY_RTV; - -typedef struct D3D10_TEX2DMS_RTV { - UINT UnusedField_NothingToDefine; -} D3D10_TEX2DMS_RTV; - -typedef struct D3D10_TEX2DMS_ARRAY_RTV { - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2DMS_ARRAY_RTV; - -typedef struct D3D10_TEX3D_RTV { - UINT MipSlice; - UINT FirstWSlice; - UINT WSize; -} D3D10_TEX3D_RTV; - -typedef struct D3D10_RENDER_TARGET_VIEW_DESC { - DXGI_FORMAT Format; - D3D10_RTV_DIMENSION ViewDimension; - union { - D3D10_BUFFER_RTV Buffer; - D3D10_TEX1D_RTV Texture1D; - D3D10_TEX1D_ARRAY_RTV Texture1DArray; - D3D10_TEX2D_RTV Texture2D; - D3D10_TEX2D_ARRAY_RTV Texture2DArray; - D3D10_TEX2DMS_RTV Texture2DMS; - D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray; - D3D10_TEX3D_RTV Texture3D; - }; -} D3D10_RENDER_TARGET_VIEW_DESC; - -typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION; - -typedef struct D3D10_BUFFER_SRV { - union { - UINT FirstElement; - UINT ElementOffset; - }; - union { - UINT NumElements; - UINT ElementWidth; - }; -} D3D10_BUFFER_SRV; - -typedef struct D3D10_TEX1D_SRV { - UINT MostDetailedMip; - UINT MipLevels; -} D3D10_TEX1D_SRV; - -typedef struct D3D10_TEX1D_ARRAY_SRV { - UINT MostDetailedMip; - UINT MipLevels; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX1D_ARRAY_SRV; - -typedef struct D3D10_TEX2D_SRV { - UINT MostDetailedMip; - UINT MipLevels; -} D3D10_TEX2D_SRV; - -typedef struct D3D10_TEX2D_ARRAY_SRV { - UINT MostDetailedMip; - UINT MipLevels; - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2D_ARRAY_SRV; - -typedef struct D3D10_TEX2DMS_SRV { - UINT UnusedField_NothingToDefine; -} D3D10_TEX2DMS_SRV; - -typedef struct D3D10_TEX2DMS_ARRAY_SRV { - UINT FirstArraySlice; - UINT ArraySize; -} D3D10_TEX2DMS_ARRAY_SRV; - -typedef struct D3D10_TEX3D_SRV { - UINT MostDetailedMip; - UINT MipLevels; -} D3D10_TEX3D_SRV; - -typedef struct D3D10_TEXCUBE_SRV { - UINT MostDetailedMip; - UINT MipLevels; -} D3D10_TEXCUBE_SRV; - -typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC { - DXGI_FORMAT Format; - D3D10_SRV_DIMENSION ViewDimension; - union { - D3D10_BUFFER_SRV Buffer; - D3D10_TEX1D_SRV Texture1D; - D3D10_TEX1D_ARRAY_SRV Texture1DArray; - D3D10_TEX2D_SRV Texture2D; - D3D10_TEX2D_ARRAY_SRV Texture2DArray; - D3D10_TEX2DMS_SRV Texture2DMS; - D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; - D3D10_TEX3D_SRV Texture3D; - D3D10_TEXCUBE_SRV TextureCube; - }; -} D3D10_SHADER_RESOURCE_VIEW_DESC; - -typedef struct D3D10_BOX { - UINT left; - UINT top; - UINT front; - UINT right; - UINT bottom; - UINT back; -} D3D10_BOX; - -typedef struct D3D10_SUBRESOURCE_DATA { - const void *pSysMem; - UINT SysMemPitch; - UINT SysMemSlicePitch; -} D3D10_SUBRESOURCE_DATA; - -typedef struct D3D10_SO_DECLARATION_ENTRY -{ - const char *SemanticName; - UINT SemanticIndex; - BYTE StartComponent; - BYTE ComponentCount; - BYTE OutputSlot; -} D3D10_SO_DECLARATION_ENTRY; - -typedef enum D3D10_INPUT_CLASSIFICATION { - D3D10_INPUT_PER_VERTEX_DATA, - D3D10_INPUT_PER_INSTANCE_DATA, -} D3D10_INPUT_CLASSIFICATION; - -typedef struct D3D10_INPUT_ELEMENT_DESC -{ - const char *SemanticName; - UINT SemanticIndex; - DXGI_FORMAT Format; - UINT InputSlot; - UINT AlignedByteOffset; - D3D10_INPUT_CLASSIFICATION InputSlotClass; - UINT InstanceDataStepRate; -} D3D10_INPUT_ELEMENT_DESC; - -typedef enum D3D10_QUERY { - D3D10_QUERY_EVENT, - D3D10_QUERY_OCCLUSION, - D3D10_QUERY_TIMESTAMP, - D3D10_QUERY_TIMESTAMP_DISJOINT, - D3D10_QUERY_PIPELINE_STATISTICS, - D3D10_QUERY_OCCLUSION_PREDICATE, - D3D10_QUERY_SO_STATISTICS, - D3D10_QUERY_SO_OVERFLOW_PREDICATE, -} D3D10_QUERY; - -typedef struct D3D10_QUERY_DESC { - D3D10_QUERY Query; - UINT MiscFlags; -} D3D10_QUERY_DESC; - -typedef D3D_PRIMITIVE_TOPOLOGY D3D10_PRIMITIVE_TOPOLOGY; - -typedef D3D_PRIMITIVE D3D10_PRIMITIVE; - -typedef RECT D3D10_RECT; - -typedef struct D3D10_VIEWPORT { - INT TopLeftX; - INT TopLeftY; - UINT Width; - UINT Height; - FLOAT MinDepth; - FLOAT MaxDepth; -} D3D10_VIEWPORT; - -typedef struct D3D10_MAPPED_TEXTURE2D { - void *pData; - UINT RowPitch; -} D3D10_MAPPED_TEXTURE2D; - -typedef struct D3D10_MAPPED_TEXTURE3D { - void *pData; - UINT RowPitch; - UINT DepthPitch; -} D3D10_MAPPED_TEXTURE3D; - -typedef enum D3D10_CPU_ACCESS_FLAG { - D3D10_CPU_ACCESS_WRITE = 0x10000, - D3D10_CPU_ACCESS_READ = 0x20000 -} D3D10_CPU_ACCESS_FLAG; - -typedef enum D3D10_RESOURCE_MISC_FLAG { - D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x0001, - D3D10_RESOURCE_MISC_SHARED = 0x0002, - D3D10_RESOURCE_MISC_TEXTURECUBE = 0x0004, - D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x0010, - D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x0020 -} D3D10_RESOURCE_MISC_FLAG; - -typedef enum D3D10_MAP_FLAG { - D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000, -} D3D10_MAP_FLAG; - -typedef enum D3D10_RAISE_FLAG { - D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1, -} D3D10_RAISE_FLAG; - -typedef enum D3D10_CLEAR_FLAG { - D3D10_CLEAR_DEPTH = 0x1, - D3D10_CLEAR_STENCIL = 0x2 -} D3D10_CLEAR_FLAG; - -typedef enum D3D10_COLOR_WRITE_ENABLE { - D3D10_COLOR_WRITE_ENABLE_RED = 0x1, - D3D10_COLOR_WRITE_ENABLE_GREEN = 0x2, - D3D10_COLOR_WRITE_ENABLE_BLUE = 0x4, - D3D10_COLOR_WRITE_ENABLE_ALPHA = 0x8, - D3D10_COLOR_WRITE_ENABLE_ALL = (D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN | - D3D10_COLOR_WRITE_ENABLE_BLUE | D3D10_COLOR_WRITE_ENABLE_ALPHA) -} D3D10_COLOR_WRITE_ENABLE; - -typedef enum D3D10_FORMAT_SUPPORT -{ - D3D10_FORMAT_SUPPORT_BUFFER = 0x00000001, - D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x00000002, - D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x00000004, - D3D10_FORMAT_SUPPORT_SO_BUFFER = 0x00000008, - D3D10_FORMAT_SUPPORT_TEXTURE1D = 0x00000010, - D3D10_FORMAT_SUPPORT_TEXTURE2D = 0x00000020, - D3D10_FORMAT_SUPPORT_TEXTURE3D = 0x00000040, - D3D10_FORMAT_SUPPORT_TEXTURECUBE = 0x00000080, - D3D10_FORMAT_SUPPORT_SHADER_LOAD = 0x00000100, - D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = 0x00000200, - D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x00000400, - D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x00000800, - D3D10_FORMAT_SUPPORT_MIP = 0x00001000, - D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = 0x00002000, - D3D10_FORMAT_SUPPORT_RENDER_TARGET = 0x00004000, - D3D10_FORMAT_SUPPORT_BLENDABLE = 0x00008000, - D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = 0x00010000, - D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = 0x00020000, - D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x00040000, - D3D10_FORMAT_SUPPORT_DISPLAY = 0x00080000, - D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x00100000, - D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x00200000, - D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x00400000, - D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x00800000, - D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x01000000, -} D3D10_FORMAT_SUPPORT; - -typedef enum D3D10_TEXTURECUBE_FACE { - D3D10_TEXTURECUBE_FACE_POSITIVE_X, - D3D10_TEXTURECUBE_FACE_NEGATIVE_X, - D3D10_TEXTURECUBE_FACE_POSITIVE_Y, - D3D10_TEXTURECUBE_FACE_NEGATIVE_Y, - D3D10_TEXTURECUBE_FACE_POSITIVE_Z, - D3D10_TEXTURECUBE_FACE_NEGATIVE_Z, -} D3D10_TEXTURECUBE_FACE; - -typedef enum D3D10_ASYNC_GETDATA_FLAG { - D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1, -} D3D10_ASYNC_GETDATA_FLAG; - -typedef enum D3D10_FILTER_TYPE { - D3D10_FILTER_TYPE_POINT, - D3D10_FILTER_TYPE_LINEAR -} D3D10_FILTER_TYPE; - -typedef enum D3D10_QUERY_MISC_FLAG { - D3D10_QUERY_MISC_PREDICATEHINT = 0x1 -} D3D10_QUERY_MISC_FLAG; - -typedef struct D3D10_QUERY_DATA_TIMESTAMP_DISJOINT { - UINT64 Frequency; - BOOL Disjoint; -} D3D10_QUERY_DATA_TIMESTAMP_DISJOINT; - -typedef struct D3D10_QUERY_DATA_PIPELINE_STATISTICS { - UINT64 IAVertices; - UINT64 IAPrimitives; - UINT64 VSInvocations; - UINT64 GSInvocations; - UINT64 GSPrimitives; - UINT64 CInvocations; - UINT64 CPrimitives; - UINT64 PSInvocations; -} D3D10_QUERY_DATA_PIPELINE_STATISTICS; - -typedef struct D3D10_QUERY_DATA_SO_STATISTICS { - UINT64 NumPrimitivesWritten; - UINT64 PrimitivesStorageNeeded; -} D3D10_QUERY_DATA_SO_STATISTICS; - -typedef enum D3D10_CREATE_DEVICE_FLAG { - D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1, - D3D10_CREATE_DEVICE_DEBUG = 0x2, - D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4, - D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, - D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = 0x10, - D3D10_CREATE_DEVICE_BGRA_SUPPORT = 0x20, - D3D10_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80, - D3D10_CREATE_DEVICE_STRICT_VALIDATION = 0x200, - D3D10_CREATE_DEVICE_DEBUGGABLE = 0x400, -} D3D10_CREATE_DEVICE_FLAG; - -/* Core */ - -interface ID3D10Device; - -[ - object, - local, - uuid(9b7e4c00-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10DeviceChild : IUnknown -{ - void GetDevice( - [out] ID3D10Device **ppDevice); - HRESULT GetPrivateData( - [in] REFGUID guid, - [in, out] UINT *pDataSize, - [out] void *pData); - HRESULT SetPrivateData( - [in] REFGUID guid, - [in] UINT DataSize, - [in] const void *pData); - HRESULT SetPrivateDataInterface( - [in] REFGUID guid, - [in] const IUnknown *pData); -} - -/* Resource */ - -[ - object, - local, - uuid(9b7e4c01-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Resource : ID3D10DeviceChild -{ - void GetType( - [out] D3D10_RESOURCE_DIMENSION *rType); - void SetEvictionPriority( - [in] UINT EvictionPriority); - UINT GetEvictionPriority(); -} - -[ - object, - local, - uuid(9b7e4c02-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Buffer : ID3D10Resource -{ - HRESULT Map( - [in] D3D10_MAP MapType, - [in] UINT MapFlags, - [out] void **ppData); - void Unmap(); - void GetDesc( - [out] D3D10_BUFFER_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c03-342c-4106-a19f-4f2704f689F0) -] -interface ID3D10Texture1D : ID3D10Resource -{ - HRESULT Map( - [in] UINT Subresource, - [in] D3D10_MAP MapType, - [in] UINT MapFlags, - [out] void **ppData); - void Unmap( - [in] UINT Subresource); - void GetDesc( - [out] D3D10_TEXTURE1D_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c04-342c-4106-a19f-4f2704f689F0) -] -interface ID3D10Texture2D : ID3D10Resource -{ - HRESULT Map( - [in] UINT Subresource, - [in] D3D10_MAP MapType, - [in] UINT MapFlags, - [out] D3D10_MAPPED_TEXTURE2D *pMappedTex2D); - void Unmap( - [in] UINT Subresource); - void GetDesc( - [out] D3D10_TEXTURE2D_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c05-342c-4106-a19f-4f2704f689F0) -] -interface ID3D10Texture3D : ID3D10Resource -{ - HRESULT Map( - [in] UINT Subresource, - [in] D3D10_MAP MapType, - [in] UINT MapFlags, - [out] D3D10_MAPPED_TEXTURE3D *pMappedTex3D); - void Unmap( - [in] UINT Subresource); - void GetDesc( - [out] D3D10_TEXTURE3D_DESC *pDesc); -} - -[ - object, - local, - uuid(c902b03f-60a7-49ba-9936-2a3ab37a7e33) -] -interface ID3D10View : ID3D10DeviceChild -{ - void GetResource( - [out] ID3D10Resource **ppResource); -} - -[ - object, - local, - uuid(9b7e4c09-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10DepthStencilView : ID3D10View -{ - void GetDesc( - [out] D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc); -} - - -[ - object, - local, - uuid(9b7e4c08-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10RenderTargetView : ID3D10View -{ - void GetDesc( - [out] D3D10_RENDER_TARGET_VIEW_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c07-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10ShaderResourceView : ID3D10View -{ - void GetDesc( - [out] D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); -} - -/* Resource End */ - -[ - object, - local, - uuid(edad8d19-8a35-4d6d-8566-2ea276cde161) -] -interface ID3D10BlendState : ID3D10DeviceChild -{ - void GetDesc( - [out] D3D10_BLEND_DESC *pDesc); -} - -[ - object, - local, - uuid(2b4b1cc8-a4ad-41f8-8322-ca86fc3ec675) -] -interface ID3D10DepthStencilState : ID3D10DeviceChild -{ - void GetDesc( - [out] D3D10_DEPTH_STENCIL_DESC *pDesc); -} - -[ - object, - local, - uuid(6316be88-54cd-4040-ab44-20461bc81f68) -] -interface ID3D10GeometryShader : ID3D10DeviceChild -{ -} - -[ - object, - local, - uuid(9b7e4c0b-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10InputLayout : ID3D10DeviceChild -{ -} - -[ - object, - local, - uuid(4968b601-9d00-4cde-8346-8e7f675819b6) -] -interface ID3D10PixelShader : ID3D10DeviceChild -{ -} - -[ - object, - local, - uuid(a2a07292-89af-4345-be2e-c53d9fbb6e9f) -] -interface ID3D10RasterizerState : ID3D10DeviceChild -{ - void GetDesc( - [out] D3D10_RASTERIZER_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c0c-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10SamplerState : ID3D10DeviceChild -{ - void GetDesc( - [out] D3D10_SAMPLER_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c0a-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10VertexShader : ID3D10DeviceChild -{ -} - -[ - object, - local, - uuid(9b7e4c0d-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Asynchronous : ID3D10DeviceChild -{ - void Begin(); - void End(); - HRESULT GetData( - [out] void *pData, - [in] UINT DataSize, - [in] UINT GetDataFlags); - UINT GetDataSize(); -} - -[ - object, - local, - uuid(9b7e4c11-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Counter : ID3D10Asynchronous -{ - void GetDesc( - [out] D3D10_COUNTER_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4C0e-342C-4106-a19f-4f2704f689f0) -] -interface ID3D10Query : ID3D10Asynchronous -{ - void GetDesc( - [out] D3D10_QUERY_DESC *pDesc); -} - -[ - object, - local, - uuid(9b7e4c10-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Predicate : ID3D10Query -{ -} - -[ - object, - local, - uuid(9b7e4c0f-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Device : IUnknown -{ - void VSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D10Buffer *const *ppConstantBuffers); - void PSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D10ShaderResourceView *const *ppShaderResourceViews); - void PSSetShader( - [in] ID3D10PixelShader *pPixelShader); - void PSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in]ID3D10SamplerState *const *ppSamplers); - void VSSetShader( - [in] ID3D10VertexShader *pVertexShader); - void DrawIndexed( - [in] UINT IndexCount, - [in] UINT StartIndexLocation, - [in] INT BaseVertexLocation); - void Draw( - [in] UINT VertexCount, - [in] UINT StartVertexLocation); - void PSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D10Buffer *const *ppConstantBuffers); - void IASetInputLayout( - [in] ID3D10InputLayout *pInputLayout); - void IASetVertexBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D10Buffer *const *ppVertexBuffers, - [in] const UINT *pStrides, - [in] const UINT *pOffsets); - void IASetIndexBuffer( - [in] ID3D10Buffer *pIndexBuffer, - [in] DXGI_FORMAT Format, - [in] UINT Offset); - void DrawIndexedInstanced( - [in] UINT IndexCountPerInstance, - [in] UINT InstanceCount, - [in] UINT StartIndexLocation, - [in] INT BaseVertexLocation, - [in] UINT StartInstanceLocation); - void DrawInstanced( - [in] UINT VertexCountPerInstance, - [in] UINT InstanceCount, - [in] UINT StartVertexLocation, - [in] UINT StartInstanceLocation); - void GSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D10Buffer *const *ppConstantBuffers); - void GSSetShader( - [in] ID3D10GeometryShader *pShader); - void IASetPrimitiveTopology( - [in] D3D10_PRIMITIVE_TOPOLOGY Topology); - void VSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D10ShaderResourceView *const *ppShaderResourceViews); - void VSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D10SamplerState *const *ppSamplers); - void SetPredication( - [in] ID3D10Predicate *pPredicate, - [in] BOOL PredicateValue); - void GSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D10ShaderResourceView * const *ppShaderResourceViews); - void GSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D10SamplerState *const *ppSamplers); - void OMSetRenderTargets( - [in] UINT NumViews, - [in] ID3D10RenderTargetView *const *ppRenderTargetViews, - [in] ID3D10DepthStencilView *pDepthStencilView); - void OMSetBlendState( - [in] ID3D10BlendState *pBlendState, - [in] const FLOAT BlendFactor[4], - [in] UINT SampleMask); - void OMSetDepthStencilState( - [in] ID3D10DepthStencilState *pDepthStencilState, - [in] UINT StencilRef); - void SOSetTargets( - [in] UINT NumBuffers, - [in] ID3D10Buffer *const *ppSOTargets, - [in] const UINT *pOffsets); - void DrawAuto(); - void RSSetState( - [in] ID3D10RasterizerState *pRasterizerState); - void RSSetViewports( - [in] UINT NumViewports, - [in] const D3D10_VIEWPORT *pViewports); - void RSSetScissorRects( - [in] UINT NumRects, - [in] const D3D10_RECT *pRects); - void CopySubresourceRegion( - [in] ID3D10Resource *pDstResource, - [in] UINT DstSubresource, - [in] UINT DstX, - [in] UINT DstY, - [in] UINT DstZ, - [in] ID3D10Resource *pSrcResource, - [in] UINT SrcSubresource, - [in] const D3D10_BOX *pSrcBox); - void CopyResource( - [in] ID3D10Resource *pDstResource, - [in] ID3D10Resource *pSrcResource); - void UpdateSubresource( - [in] ID3D10Resource *pDstResource, - [in] UINT DstSubresource, - [in] const D3D10_BOX *pDstBox, - [in] const void *pSrcData, - [in] UINT SrcRowPitch, - [in] UINT SrcDepthPitch); - void ClearRenderTargetView( - [in] ID3D10RenderTargetView *pRenderTargetView, - [in] const FLOAT ColorRGBA[4]); - void ClearDepthStencilView( - [in] ID3D10DepthStencilView *pDepthStencilView, - [in] UINT ClearFlags, - [in] FLOAT Depth, - [in] UINT8 Stencil); - void GenerateMips( - [in] ID3D10ShaderResourceView *pShaderResourceView); - void ResolveSubresource( - [in] ID3D10Resource *pDstResource, - [in] UINT DstSubresource, - [in] ID3D10Resource *pSrcResource, - [in] UINT SrcSubresource, - [in] DXGI_FORMAT Format); - void VSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D10Buffer **ppConstantBuffers); - void PSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D10ShaderResourceView **ppShaderResourceViews); - void PSGetShader( - [out] ID3D10PixelShader **ppPixelShader); - void PSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D10SamplerState **ppSamplers); - void VSGetShader( - [out] ID3D10VertexShader **ppVertexShader); - void PSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D10Buffer **ppConstantBuffers); - void IAGetInputLayout( - [out] ID3D10InputLayout **ppInputLayout); - void IAGetVertexBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D10Buffer **ppVertexBuffers, - [out] UINT *pStrides, - [out] UINT *pOffsets); - void IAGetIndexBuffer( - [out] ID3D10Buffer **pIndexBuffer, - [out] DXGI_FORMAT *Format, - [out] UINT *Offset); - void GSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D10Buffer **ppConstantBuffers); - void GSGetShader( - [out] ID3D10GeometryShader **ppGeometryShader); - void IAGetPrimitiveTopology( - [out] D3D10_PRIMITIVE_TOPOLOGY *pTopology); - void VSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D10ShaderResourceView **ppShaderResourceViews); - void VSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D10SamplerState **ppSamplers); - void GetPredication( - [out] ID3D10Predicate **ppPredicate, - [out] BOOL *pPredicateValue); - void GSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D10ShaderResourceView **ppShaderResourceViews); - void GSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D10SamplerState **ppSamplers); - void OMGetRenderTargets( - [in] UINT NumViews, - [out] ID3D10RenderTargetView **ppRenderTargetViews, - [out] ID3D10DepthStencilView **ppDepthStencilView); - void OMGetBlendState( - [out] ID3D10BlendState **ppBlendState, - [out] FLOAT BlendFactor[4], - [out] UINT *pSampleMask); - void OMGetDepthStencilState( - [out] ID3D10DepthStencilState **ppDepthStencilState, - [out] UINT *pStencilRef); - void SOGetTargets( - [in] UINT NumBuffers, - [out] ID3D10Buffer **ppSOTargets, - [out] UINT *pOffsets); - void RSGetState( - [out] ID3D10RasterizerState **ppRasterizerState); - void RSGetViewports( - [in, out] UINT *NumViewports, - [out] D3D10_VIEWPORT *pViewports); - void RSGetScissorRects( - [in, out] UINT *NumRects, - [out] D3D10_RECT *pRects); - HRESULT GetDeviceRemovedReason(); - HRESULT SetExceptionMode( - [in] UINT RaiseFlags); - UINT GetExceptionMode(); - HRESULT GetPrivateData( - [in] REFGUID guid, - [in, out] UINT *pDataSize, - [out] void *pData); - HRESULT SetPrivateData( - [in] REFGUID guid, - [in] UINT DataSize, - [in] const void *pData); - HRESULT SetPrivateDataInterface( - [in] REFGUID guid, - [in] const IUnknown *pData); - void ClearState(); - void Flush(); - HRESULT CreateBuffer( - [in] const D3D10_BUFFER_DESC *pDesc, - [in] const D3D10_SUBRESOURCE_DATA *pInitialData, - [out] ID3D10Buffer **ppBuffer); - HRESULT CreateTexture1D( - [in] const D3D10_TEXTURE1D_DESC *pDesc, - [in] const D3D10_SUBRESOURCE_DATA *pInitialData, - [out] ID3D10Texture1D **ppTexture1D); - HRESULT CreateTexture2D( - [in] const D3D10_TEXTURE2D_DESC *pDesc, - [in] const D3D10_SUBRESOURCE_DATA *pInitialData, - [out] ID3D10Texture2D **ppTexture2D); - HRESULT CreateTexture3D( - [in] const D3D10_TEXTURE3D_DESC *pDesc, - [in] const D3D10_SUBRESOURCE_DATA *pInitialData, - [out] ID3D10Texture3D **ppTexture3D); - HRESULT CreateShaderResourceView( - [in] ID3D10Resource *pResource, - [in] const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, - [out] ID3D10ShaderResourceView **ppSRView); - HRESULT CreateRenderTargetView( - [in] ID3D10Resource *pResource, - [in] const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, - [out] ID3D10RenderTargetView **ppRTView); - HRESULT CreateDepthStencilView( - [in] ID3D10Resource *pResource, - [in] const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, - [out] ID3D10DepthStencilView **ppDepthStencilView); - HRESULT CreateInputLayout( - [in] const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, - [in] UINT NumElements, - [in] const void *pShaderBytecodeWithInputSignature, - [in] SIZE_T BytecodeLength, - [out] ID3D10InputLayout **ppInputLayout); - HRESULT CreateVertexShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [out] ID3D10VertexShader **ppVertexShader); - HRESULT CreateGeometryShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [out] ID3D10GeometryShader **ppGeometryShader); - HRESULT CreateGeometryShaderWithStreamOutput( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, - [in] UINT NumEntries, - [in] UINT OutputStreamStride, - [out] ID3D10GeometryShader **ppGeometryShader); - HRESULT CreatePixelShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [out] ID3D10PixelShader **ppPixelShader); - HRESULT CreateBlendState( - [in] const D3D10_BLEND_DESC *pBlendStateDesc, - [out] ID3D10BlendState **ppBlendState); - HRESULT CreateDepthStencilState( - [in] const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, - [out] ID3D10DepthStencilState **ppDepthStencilState); - HRESULT CreateRasterizerState( - [in] const D3D10_RASTERIZER_DESC *pRasterizerDesc, - [out] ID3D10RasterizerState **ppRasterizerState); - HRESULT CreateSamplerState( - [in] const D3D10_SAMPLER_DESC *pSamplerDesc, - [out] ID3D10SamplerState **ppSamplerState); - HRESULT CreateQuery( - [in] const D3D10_QUERY_DESC *pQueryDesc, - [out] ID3D10Query **ppQuery); - HRESULT CreatePredicate( - [in] const D3D10_QUERY_DESC *pPredicateDesc, - [out] ID3D10Predicate **ppPredicate); - HRESULT CreateCounter( - [in] const D3D10_COUNTER_DESC *pCounterDesc, - [out] ID3D10Counter **ppCounter); - HRESULT CheckFormatSupport( - [in] DXGI_FORMAT Format, - [out] UINT *pFormatSupport); - HRESULT CheckMultisampleQualityLevels( - [in] DXGI_FORMAT Format, - [in] UINT SampleCount, - [out] UINT *pNumQualityLevels); - void CheckCounterInfo( - [out] D3D10_COUNTER_INFO *pCounterInfo); - HRESULT CheckCounter( - [in] const D3D10_COUNTER_DESC *pDesc, - [out] D3D10_COUNTER_TYPE *pType, - [out] UINT *pActiveCounters, - [out] char *name, - [in, out] UINT *pNameLength, - [out] char *units, - [in, out] UINT *pUnitsLength, - [out] char *description, - [in, out] UINT *pDescriptionLength); - UINT GetCreationFlags(); - HRESULT OpenSharedResource( - [in] HANDLE hResource, - [in] REFIID ReturnedInterface, - [out] void **ppResource); - void SetTextFilterSize( - [in] UINT Width, - [in] UINT Height); - void GetTextFilterSize( - [out] UINT *pWidth, - [out] UINT *pHeight); -} - -[ - object, - local, - uuid(9b7e4e00-342c-4106-a19f-4f2704f689f0) -] -interface ID3D10Multithread : IUnknown -{ - void Enter(); - void Leave(); - BOOL SetMultithreadProtected( - [in] BOOL bMTProtect); - BOOL GetMultithreadProtected(); -} - -cpp_quote("#ifndef D3D10_IGNORE_SDK_LAYERS") -cpp_quote("#include \"d3d10sdklayers.h\"") -cpp_quote("#endif") -cpp_quote("#include \"d3d10misc.h\"") -cpp_quote("#include \"d3d10shader.h\"") -cpp_quote("#include \"d3d10effect.h\"") diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1.idl b/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1.idl deleted file mode 100644 index a37ff9ea3b2..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1.idl +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2010 Jacek Caban for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; - -cpp_quote("#ifndef _D3D10_1_CONSTANTS") -cpp_quote("#define _D3D10_1_CONSTANTS") -const UINT D3D10_1_DEFAULT_SAMPLE_MASK = 0xffffffff; -const UINT D3D10_1_GS_INPUT_REGISTER_COUNT = 32; -const UINT D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32; -const UINT D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = 128; -const UINT D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = 32; -const UINT D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS = 1; -const UINT D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT = 1; -const UINT D3D10_1_SHADER_MAJOR_VERSION = 4; -const UINT D3D10_1_SHADER_MINOR_VERSION = 1; -const UINT D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048; -const UINT D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 256; -const UINT D3D10_1_SO_BUFFER_SLOT_COUNT = 4; -const UINT D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER = 1; -const UINT D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT = 64; -const UINT D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT = 32; -const UINT D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT = 8; -const UINT D3D10_1_VS_INPUT_REGISTER_COUNT = 32; -const UINT D3D10_1_VS_OUTPUT_REGISTER_COUNT = 32; -cpp_quote("#endif") - -cpp_quote("#define D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP (0.6)") -cpp_quote("#define D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP (0.6f)") - -import "d3d10.idl"; -cpp_quote("#include ") - - -typedef enum D3D10_FEATURE_LEVEL1 -{ - D3D10_FEATURE_LEVEL_10_0 = 0xa000, - D3D10_FEATURE_LEVEL_10_1 = 0xa100, - D3D10_FEATURE_LEVEL_9_1 = 0x9100, - D3D10_FEATURE_LEVEL_9_2 = 0x9200, - D3D10_FEATURE_LEVEL_9_3 = 0x9300 -} D3D10_FEATURE_LEVEL1; - -typedef struct D3D10_RENDER_TARGET_BLEND_DESC1 -{ - BOOL BlendEnable; - D3D10_BLEND SrcBlend; - D3D10_BLEND DestBlend; - D3D10_BLEND_OP BlendOp; - D3D10_BLEND SrcBlendAlpha; - D3D10_BLEND DestBlendAlpha; - D3D10_BLEND_OP BlendOpAlpha; - UINT8 RenderTargetWriteMask; -} D3D10_RENDER_TARGET_BLEND_DESC1; - -typedef struct D3D10_BLEND_DESC1 -{ - BOOL AlphaToCoverageEnable; - BOOL IndependentBlendEnable; - D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT]; -} D3D10_BLEND_DESC1; - -[ - uuid(edad8d99-8a35-4d6d-8566-2ea276cde161), - object, - local, - pointer_default(unique) -] -interface ID3D10BlendState1 : ID3D10BlendState -{ - void GetDesc1([out] D3D10_BLEND_DESC1 *pDesc); -} - -typedef struct D3D10_TEXCUBE_ARRAY_SRV1 -{ - UINT MostDetailedMip; - UINT MipLevels; - UINT First2DArrayFace; - UINT NumCubes; -} D3D10_TEXCUBE_ARRAY_SRV1; - -typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1; - -typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1 -{ - DXGI_FORMAT Format; - D3D10_SRV_DIMENSION1 ViewDimension; - union { - D3D10_BUFFER_SRV Buffer; - D3D10_TEX1D_SRV Texture1D; - D3D10_TEX1D_ARRAY_SRV Texture1DArray; - D3D10_TEX2D_SRV Texture2D; - D3D10_TEX2D_ARRAY_SRV Texture2DArray; - D3D10_TEX2DMS_SRV Texture2DMS; - D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; - D3D10_TEX3D_SRV Texture3D; - D3D10_TEXCUBE_SRV TextureCube; - D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray; - }; -} D3D10_SHADER_RESOURCE_VIEW_DESC1; - -[ - uuid(9b7e4c87-342c-4106-a19f-4f2704f689f0), - object, - local, - pointer_default(unique) -] -interface ID3D10ShaderResourceView1 : ID3D10ShaderResourceView -{ - void GetDesc1([out] D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc); -} - -[ - uuid(9b7e4c8f-342c-4106-a19f-4f2704f689f0), - object, - local, - pointer_default(unique) -] -interface ID3D10Device1 : ID3D10Device -{ - HRESULT CreateShaderResourceView1( - [in] ID3D10Resource *pResource, - [in, out] const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, - [out] ID3D10ShaderResourceView1 **ppSRView); - - HRESULT CreateBlendState1( - [in] const D3D10_BLEND_DESC1 *pBlendStateDesc, - [out] ID3D10BlendState1 **ppBlendState); - - D3D10_FEATURE_LEVEL1 GetFeatureLevel(); -} - -const UINT D3D10_1_SDK_VERSION = 0x20; - -cpp_quote("HRESULT WINAPI D3D10CreateDevice1(IDXGIAdapter*,D3D10_DRIVER_TYPE,") -cpp_quote(" HMODULE,UINT,D3D10_FEATURE_LEVEL1,UINT,ID3D10Device1**);") - -[local] HRESULT __stdcall D3D10CreateDeviceAndSwapChain1(IDXGIAdapter *adapter, enum D3D10_DRIVER_TYPE driver_type, - HMODULE swrast, UINT flags, D3D10_FEATURE_LEVEL1 feature_level, UINT sdk_version, - DXGI_SWAP_CHAIN_DESC *swapchain_desc, IDXGISwapChain **swapchain, ID3D10Device1 **device); diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1shader.h b/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1shader.h deleted file mode 100644 index 06dded7e0e8..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d10_1shader.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2010 Rico Schüller - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __D3D10_1SHADER_H__ -#define __D3D10_1SHADER_H__ - -#include "d3d10shader.h" - -DEFINE_GUID(IID_ID3D10ShaderReflection1, 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47); - -#define INTERFACE ID3D10ShaderReflection1 -DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown) -{ - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - /* ID3D10ShaderReflection1 methods */ - STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE; - STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE; - STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; - STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE; - STDMETHOD(GetResourceBindingDescByName)(THIS_ const char *name, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE; - STDMETHOD(GetMovInstructionCount)(THIS_ UINT *count) PURE; - STDMETHOD(GetMovcInstructionCount)(THIS_ UINT *count) PURE; - STDMETHOD(GetConversionInstructionCount)(THIS_ UINT *count) PURE; - STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT *count) PURE; - STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE *prim) PURE; - STDMETHOD(IsLevel9Shader)(THIS_ BOOL *level9shader) PURE; - STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL *samplefrequency) PURE; -}; -#undef INTERFACE - -#endif diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d10sdklayers.idl b/wrappers/to-synch/sdk/include/reactos/wine/d3d10sdklayers.idl deleted file mode 100644 index 317f7c23e02..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d10sdklayers.idl +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Copyright 2016 Alistair Leslie-Hughes - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgi.idl"; - -cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") -cpp_quote("#undef GetMessage") -cpp_quote("#endif") - -const UINT D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP = 0x1; -const UINT D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP = 0x2; -const UINT D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP = 0x4; - -typedef enum D3D10_MESSAGE_CATEGORY -{ - D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED, - D3D10_MESSAGE_CATEGORY_MISCELLANEOUS, - D3D10_MESSAGE_CATEGORY_INITIALIZATION, - D3D10_MESSAGE_CATEGORY_CLEANUP, - D3D10_MESSAGE_CATEGORY_COMPILATION, - D3D10_MESSAGE_CATEGORY_STATE_CREATION, - D3D10_MESSAGE_CATEGORY_STATE_SETTING, - D3D10_MESSAGE_CATEGORY_STATE_GETTING, - D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION, - D3D10_MESSAGE_CATEGORY_EXECUTION, - D3D10_MESSAGE_CATEGORY_SHADER, -} D3D10_MESSAGE_CATEGORY; - -typedef enum D3D10_MESSAGE_SEVERITY -{ - D3D10_MESSAGE_SEVERITY_CORRUPTION, - D3D10_MESSAGE_SEVERITY_ERROR, - D3D10_MESSAGE_SEVERITY_WARNING, - D3D10_MESSAGE_SEVERITY_INFO, - D3D10_MESSAGE_SEVERITY_MESSAGE, -} D3D10_MESSAGE_SEVERITY; - -typedef enum D3D10_MESSAGE_ID -{ - D3D10_MESSAGE_ID_UNKNOWN = 0, - D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD, - D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD, - D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD, - D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD, - D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD, - D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD, - D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD, - D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD, - D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD, - D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD, - D3D10_MESSAGE_ID_STRING_FROM_APPLICATION, - D3D10_MESSAGE_ID_CORRUPTED_THIS, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14, - D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15, - D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING, - D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY, - D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT, - D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA, - D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA, - D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN, - D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS, - D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS, - D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES, - D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE, - D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC, - D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS, - D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC, - D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC, - D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS, - D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC, - D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC, - D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE, - D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE, - D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY, - D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE, - D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC, - D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY, - D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS, - D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG, - D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC, - D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED, - D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED, - D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE, - D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID, - D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE, - D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT, - D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR, - D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH, - D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH, - D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID, - D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY, - D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE, - D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE, - D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE, - D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE, - D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE, - D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE, - D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX, - D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE, - D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID, - D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID, - D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID, - D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID, - D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID, - D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE, - D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS, - D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED, - D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN, - D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED, - D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE, - D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS, - D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED, - D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN, - D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED, - D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE, - D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS, - D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED, - D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN, - D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED, - D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE, - D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS, - D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED, - D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN, - D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE, - D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED, - D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED, - D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED, - D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS, - D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN, - D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE, - D3D10_MESSAGE_ID_REF_THREADING_MODE, - D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION, - D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION, - D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION, - D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE, - D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER, - D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY, - D3D10_MESSAGE_ID_REF_INFO, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE, - D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL, - D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL, - D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID, - D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL, - D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH, - D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT, - D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET, - D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED, - D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE, - D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER, - D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING, - D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0, - D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT, - D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT, - D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT, - D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN, - D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN, - D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC, - D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC, - D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH, - D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW, - D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS, - D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH, - D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY, - D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY, - D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER, - D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED, - D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER, - D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN, - D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN, - D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC, - D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER, - D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER, - D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE, - D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED, - D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION, - D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE, - D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS, - D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION, - D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS, - D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN, - D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE, - D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS, - D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL, - D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN, - D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE, - D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT, - D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH, - D3D10_MESSAGE_ID_LIVE_OBJECT_SUMMARY, - D3D10_MESSAGE_ID_LIVE_BUFFER, - D3D10_MESSAGE_ID_LIVE_TEXTURE1D, - D3D10_MESSAGE_ID_LIVE_TEXTURE2D, - D3D10_MESSAGE_ID_LIVE_TEXTURE3D, - D3D10_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW, - D3D10_MESSAGE_ID_LIVE_RENDERTARGETVIEW, - D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW, - D3D10_MESSAGE_ID_LIVE_VERTEXSHADER, - D3D10_MESSAGE_ID_LIVE_GEOMETRYSHADER, - D3D10_MESSAGE_ID_LIVE_PIXELSHADER, - D3D10_MESSAGE_ID_LIVE_INPUTLAYOUT, - D3D10_MESSAGE_ID_LIVE_SAMPLER, - D3D10_MESSAGE_ID_LIVE_BLENDSTATE, - D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE, - D3D10_MESSAGE_ID_LIVE_RASTERIZERSTATE, - D3D10_MESSAGE_ID_LIVE_QUERY, - D3D10_MESSAGE_ID_LIVE_PREDICATE, - D3D10_MESSAGE_ID_LIVE_COUNTER, - D3D10_MESSAGE_ID_LIVE_DEVICE, - D3D10_MESSAGE_ID_LIVE_SWAPCHAIN, - D3D10_MESSAGE_ID_D3D10_MESSAGES_END, - - D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x00100000, - D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE, - D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED, - D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS, - D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D, - D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE, - D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE, - D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS, - D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS, - D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX, - D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS, - D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED, - D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS, - D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY, - D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK, - D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK, - D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE, - D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE, - D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO, - D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES, - D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER, - D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE, - D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT, - D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS, - D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES, - D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED, - D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED, - D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED, - D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED, - D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND, - D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE, - D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED, - D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3, - D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED, - D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO, - D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION, - D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED, - D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR, - D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA, - D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP, - D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED, - D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT, - D3D10_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES, - D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END, -} D3D10_MESSAGE_ID; - -typedef struct D3D10_MESSAGE -{ - D3D10_MESSAGE_CATEGORY Category; - D3D10_MESSAGE_SEVERITY Severity; - D3D10_MESSAGE_ID ID; - const char *pDescription; - SIZE_T DescriptionByteLength; -} D3D10_MESSAGE; - -typedef struct D3D10_INFO_QUEUE_FILTER_DESC -{ - UINT NumCategories; - D3D10_MESSAGE_CATEGORY *pCategoryList; - UINT NumSeverities; - D3D10_MESSAGE_SEVERITY *pSeverityList; - UINT NumIDs; - D3D10_MESSAGE_ID *pIDList; -} D3D10_INFO_QUEUE_FILTER_DESC; - -typedef struct D3D10_INFO_QUEUE_FILTER -{ - D3D10_INFO_QUEUE_FILTER_DESC AllowList; - D3D10_INFO_QUEUE_FILTER_DESC DenyList; -} D3D10_INFO_QUEUE_FILTER; - -[ - local, - object, - uuid(9b7e4e01-342c-4106-a19f-4f2704f689f0), - pointer_default(unique) -] -interface ID3D10Debug : IUnknown -{ - HRESULT SetFeatureMask( - [in] UINT mask - ); - UINT GetFeatureMask(); - HRESULT SetPresentPerRenderOpDelay( - [in] UINT milliseconds - ); - UINT GetPresentPerRenderOpDelay(); - HRESULT SetSwapChain( - [in] IDXGISwapChain *swapchain - ); - HRESULT GetSwapChain( - [out] IDXGISwapChain **swapchain - ); - HRESULT Validate(); -} - -[ - local, - object, - uuid(9b7e4e02-342c-4106-a19f-4f2704f689f0), - pointer_default(unique) -] -interface ID3D10SwitchToRef : IUnknown -{ - BOOL SetUseRef( - [in] BOOL useref - ); - BOOL GetUseRef(); -} - -[ - local, - object, - uuid(1b940b17-2642-4d1f-ab1f-b99bad0c395f), - pointer_default(unique) -] -interface ID3D10InfoQueue : IUnknown -{ - HRESULT SetMessageCountLimit( - [in] UINT64 limit - ); - void ClearStoredMessages(); - HRESULT GetMessage( - [in] UINT64 message_idx, - [out] D3D10_MESSAGE *message, - [in, out] SIZE_T *message_size - ); - UINT64 GetNumMessagesAllowedByStorageFilter(); - UINT64 GetNumMessagesDeniedByStorageFilter(); - UINT64 GetNumStoredMessages(); - UINT64 GetNumStoredMessagesAllowedByRetrievalFilter(); - UINT64 GetNumMessagesDiscardedByMessageCountLimit(); - UINT64 GetMessageCountLimit(); - HRESULT AddStorageFilterEntries( - [in] D3D10_INFO_QUEUE_FILTER *filter - ); - HRESULT GetStorageFilter( - [out] D3D10_INFO_QUEUE_FILTER *filter, - [in, out] SIZE_T *filter_size - ); - void ClearStorageFilter(); - HRESULT PushEmptyStorageFilter(); - HRESULT PushCopyOfStorageFilter(); - HRESULT PushStorageFilter( - [in] D3D10_INFO_QUEUE_FILTER *filter - ); - void PopStorageFilter(); - UINT GetStorageFilterStackSize(); - HRESULT AddRetrievalFilterEntries( - [in] D3D10_INFO_QUEUE_FILTER *filter - ); - HRESULT GetRetrievalFilter( - [out] D3D10_INFO_QUEUE_FILTER *filter, - [in, out] SIZE_T *filterbytelength - ); - void ClearRetrievalFilter(); - HRESULT PushEmptyRetrievalFilter(); - HRESULT PushCopyOfRetrievalFilter(); - HRESULT PushRetrievalFilter( - [in] D3D10_INFO_QUEUE_FILTER *filter - ); - void PopRetrievalFilter(); - UINT GetRetrievalFilterStackSize(); - HRESULT AddMessage( - [in] D3D10_MESSAGE_CATEGORY category, - [in] D3D10_MESSAGE_SEVERITY severity, - [in] D3D10_MESSAGE_ID id, - [in] const char *description - ); - HRESULT AddApplicationMessage( - [in] D3D10_MESSAGE_SEVERITY severity, - [in] const char *description - ); - HRESULT SetBreakOnCategory( - [in] D3D10_MESSAGE_CATEGORY category, - [in] BOOL enable - ); - HRESULT SetBreakOnSeverity( - [in] D3D10_MESSAGE_SEVERITY severity, - [in] BOOL enable - ); - HRESULT SetBreakOnID( - [in] D3D10_MESSAGE_ID id, - [in] BOOL enable - ); - BOOL GetBreakOnCategory( - [in] D3D10_MESSAGE_CATEGORY category - ); - BOOL GetBreakOnSeverity( - [in] D3D10_MESSAGE_SEVERITY severity - ); - BOOL GetBreakOnID( - [in] D3D10_MESSAGE_ID id - ); - void SetMuteDebugOutput( - [in] BOOL mute - ); - BOOL GetMuteDebugOutput(); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d10shader.h b/wrappers/to-synch/sdk/include/reactos/wine/d3d10shader.h deleted file mode 100644 index 4a2fef95372..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d10shader.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2009 Henri Verbeet for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#ifndef __WINE_D3D10SHADER_H -#define __WINE_D3D10SHADER_H - -#include "d3d10.h" - -#define D3D10_SHADER_DEBUG 0x0001 -#define D3D10_SHADER_SKIP_VALIDATION 0x0002 -#define D3D10_SHADER_SKIP_OPTIMIZATION 0x0004 -#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR 0x0008 -#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR 0x0010 -#define D3D10_SHADER_PARTIAL_PRECISION 0x0020 -#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT 0x0040 -#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT 0x0080 -#define D3D10_SHADER_NO_PRESHADER 0x0100 -#define D3D10_SHADER_AVOID_FLOW_CONTROL 0x0200 -#define D3D10_SHADER_PREFER_FLOW_CONTROL 0x0400 -#define D3D10_SHADER_ENABLE_STRICTNESS 0x0800 -#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000 -#define D3D10_SHADER_IEEE_STRICTNESS 0x2000 -#define D3D10_SHADER_WARNINGS_ARE_ERRORS 0x40000 - -#define D3D10_SHADER_OPTIMIZATION_LEVEL0 0x4000 -#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0x0000 -#define D3D10_SHADER_OPTIMIZATION_LEVEL2 0xC000 -#define D3D10_SHADER_OPTIMIZATION_LEVEL3 0x8000 - -/* These are defined as version-neutral in d3dcommon.h */ -typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO; -typedef D3D_SHADER_MACRO *LPD3D10_SHADER_MACRO; - -typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS; -typedef D3D_SHADER_VARIABLE_CLASS *LPD3D10_SHADER_VARIABLE_CLASS; - -typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE; -typedef D3D_CBUFFER_TYPE *LPD3D10_CBUFFER_TYPE; - -typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE; - -typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE; - -typedef D3D_NAME D3D10_NAME; - -typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE; -typedef D3D_SHADER_INPUT_TYPE *LPD3D10_SHADER_INPUT_TYPE; - -typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE; -typedef D3D_SHADER_VARIABLE_TYPE *LPD3D10_SHADER_VARIABLE_TYPE; - -typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE; -typedef ID3DInclude ID3D10Include; -typedef ID3DInclude *LPD3D10INCLUDE; -#define IID_ID3D10Include IID_ID3DInclude - -typedef struct _D3D10_SHADER_INPUT_BIND_DESC -{ - const char *Name; - D3D10_SHADER_INPUT_TYPE Type; - UINT BindPoint; - UINT BindCount; - UINT uFlags; - D3D10_RESOURCE_RETURN_TYPE ReturnType; - D3D10_SRV_DIMENSION Dimension; - UINT NumSamples; -} D3D10_SHADER_INPUT_BIND_DESC; - -typedef struct _D3D10_SIGNATURE_PARAMETER_DESC -{ - const char *SemanticName; - UINT SemanticIndex; - UINT Register; - D3D10_NAME SystemValueType; - D3D10_REGISTER_COMPONENT_TYPE ComponentType; - BYTE Mask; - BYTE ReadWriteMask; -} D3D10_SIGNATURE_PARAMETER_DESC; - -typedef struct _D3D10_SHADER_DESC -{ - UINT Version; - const char *Creator; - UINT Flags; - UINT ConstantBuffers; - UINT BoundResources; - UINT InputParameters; - UINT OutputParameters; - UINT InstructionCount; - UINT TempRegisterCount; - UINT TempArrayCount; - UINT DefCount; - UINT DclCount; - UINT TextureNormalInstructions; - UINT TextureLoadInstructions; - UINT TextureCompInstructions; - UINT TextureBiasInstructions; - UINT TextureGradientInstructions; - UINT FloatInstructionCount; - UINT IntInstructionCount; - UINT UintInstructionCount; - UINT StaticFlowControlCount; - UINT DynamicFlowControlCount; - UINT MacroInstructionCount; - UINT ArrayInstructionCount; - UINT CutInstructionCount; - UINT EmitInstructionCount; - D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; - UINT GSMaxOutputVertexCount; -} D3D10_SHADER_DESC; - -typedef struct _D3D10_SHADER_BUFFER_DESC -{ - const char *Name; - D3D10_CBUFFER_TYPE Type; - UINT Variables; - UINT Size; - UINT uFlags; -} D3D10_SHADER_BUFFER_DESC; - -typedef struct _D3D10_SHADER_VARIABLE_DESC -{ - const char *Name; - UINT StartOffset; - UINT Size; - UINT uFlags; - void *DefaultValue; -} D3D10_SHADER_VARIABLE_DESC; - -typedef struct _D3D10_SHADER_TYPE_DESC -{ - D3D10_SHADER_VARIABLE_CLASS Class; - D3D10_SHADER_VARIABLE_TYPE Type; - UINT Rows; - UINT Columns; - UINT Elements; - UINT Members; - UINT Offset; -} D3D10_SHADER_TYPE_DESC; - -DEFINE_GUID(IID_ID3D10ShaderReflectionType, 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd); - -#define INTERFACE ID3D10ShaderReflectionType -DECLARE_INTERFACE(ID3D10ShaderReflectionType) -{ - STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE; - STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE; -}; -#undef INTERFACE - -DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1); - -#define INTERFACE ID3D10ShaderReflectionVariable -DECLARE_INTERFACE(ID3D10ShaderReflectionVariable) -{ - STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionType *, GetType)(THIS) PURE; -}; -#undef INTERFACE - -DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0); - -#define INTERFACE ID3D10ShaderReflectionConstantBuffer -DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer) -{ - STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE; -}; -#undef INTERFACE - -DEFINE_GUID(IID_ID3D10ShaderReflection, 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa); - -#define INTERFACE ID3D10ShaderReflection -DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown) -{ - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - /* ID3D10ShaderReflection methods */ - STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *desc) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE; - STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE; - STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; - STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; -}; -#undef INTERFACE - - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI D3D10CompileShader(const char *data, SIZE_T data_size, const char *filename, - const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint, - const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages); -HRESULT WINAPI D3D10DisassembleShader(const void *data, SIZE_T data_size, - BOOL color_code, const char *comments, ID3D10Blob **disassembly); -const char * WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device); -const char * WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device); -const char * WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device); - -HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector); -HRESULT WINAPI D3D10GetInputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); -HRESULT WINAPI D3D10GetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); -HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); -HRESULT WINAPI D3D10GetShaderDebugInfo(const void *data, SIZE_T data_size, ID3D10Blob **blob); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_D3D10SHADER_H */ diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d11.idl b/wrappers/to-synch/sdk/include/reactos/wine/d3d11.idl deleted file mode 100644 index 982f4abb8ae..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d11.idl +++ /dev/null @@ -1,3951 +0,0 @@ -/* - * Copyright 2010 Rico Schüller - * Copyright 2013 Austin English - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgi.idl"; -import "d3dcommon.idl"; - -typedef D3D_PRIMITIVE D3D11_PRIMITIVE; -typedef D3D_PRIMITIVE_TOPOLOGY D3D11_PRIMITIVE_TOPOLOGY; -typedef D3D_SRV_DIMENSION D3D11_SRV_DIMENSION; -typedef RECT D3D11_RECT; - -interface ID3D11Device; -interface ID3D11ClassLinkage; -interface ID3D11Resource; -interface ID3D11VideoProcessorInputView; - -cpp_quote("#ifndef _D3D11_CONSTANTS") -cpp_quote("#define _D3D11_CONSTANTS") - -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = 14; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = 4; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT = 15; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT = 16; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = 15; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; -const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; -const UINT D3D11_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT = 64; -const UINT D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; -const UINT D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT = 1; -const UINT D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; -const UINT D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; -const UINT D3D11_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS = 1; -const UINT D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT = 128; -const UINT D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST = 1; -const UINT D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS = 1; -const UINT D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = 128; -const UINT D3D11_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS = 1; -const UINT D3D11_COMMONSHADER_SAMPLER_REGISTER_COUNT = 16; -const UINT D3D11_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST = 1; -const UINT D3D11_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS = 1; -const UINT D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT = 16; -const UINT D3D11_COMMONSHADER_SUBROUTINE_NESTING_LIMIT = 32; -const UINT D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENTS = 4; -const UINT D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_COMMONSHADER_TEMP_REGISTER_COUNT = 4096; -const UINT D3D11_COMMONSHADER_TEMP_REGISTER_READS_PER_INST = 3; -const UINT D3D11_COMMONSHADER_TEMP_REGISTER_READ_PORTS = 3; -const UINT D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX = 10; -const INT D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN = -10; -const INT D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE = -8; -const UINT D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE = 7; - -const UINT D3D11_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 256; -const UINT D3D11_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP = 64; -const UINT D3D11_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 240; -const UINT D3D11_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP = 68; -const UINT D3D11_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 224; -const UINT D3D11_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP = 72; -const UINT D3D11_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 208; -const UINT D3D11_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP = 76; -const UINT D3D11_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 192; -const UINT D3D11_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP = 84; -const UINT D3D11_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 176; -const UINT D3D11_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP = 92; -const UINT D3D11_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 160; -const UINT D3D11_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP = 100; -const UINT D3D11_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 144; -const UINT D3D11_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP = 112; -const UINT D3D11_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 128; -const UINT D3D11_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP = 128; -const UINT D3D11_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 112; -const UINT D3D11_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP = 144; -const UINT D3D11_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 96; -const UINT D3D11_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP = 168; -const UINT D3D11_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 80; -const UINT D3D11_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP = 204; -const UINT D3D11_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 64; -const UINT D3D11_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP = 256; -const UINT D3D11_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 48; -const UINT D3D11_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP = 340; -const UINT D3D11_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 32; -const UINT D3D11_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP = 512; -const UINT D3D11_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 16; -const UINT D3D11_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP = 768; -const UINT D3D11_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION = 1; -const UINT D3D11_CS_4_X_RAW_UAV_BYTE_ALIGNMENT = 256; -const UINT D3D11_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP = 768; -const UINT D3D11_CS_4_X_THREAD_GROUP_MAX_X = 768; -const UINT D3D11_CS_4_X_THREAD_GROUP_MAX_Y = 768; -const UINT D3D11_CS_4_X_UAV_REGISTER_COUNT = 1; -const UINT D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION = 65535; -const UINT D3D11_CS_TGSM_REGISTER_COUNT = 8192; -const UINT D3D11_CS_TGSM_REGISTER_READS_PER_INST = 1; -const UINT D3D11_CS_TGSM_RESOURCE_REGISTER_COMPONENTS = 1; -const UINT D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS = 1; -const UINT D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP = 1024; -const UINT D3D11_CS_THREAD_GROUP_MAX_X = 1024; -const UINT D3D11_CS_THREAD_GROUP_MAX_Y = 1024; -const UINT D3D11_CS_THREAD_GROUP_MAX_Z = 64; -const UINT D3D11_CS_THREAD_GROUP_MIN_X = 1; -const UINT D3D11_CS_THREAD_GROUP_MIN_Y = 1; -const UINT D3D11_CS_THREAD_GROUP_MIN_Z = 1; -const UINT D3D11_CS_THREAD_LOCAL_TEMP_REGISTER_POOL = 16384; - -const UINT D3D11_DEFAULT_DEPTH_BIAS = 0; -cpp_quote("#define D3D11_DEFAULT_DEPTH_BIAS_CLAMP 0.0f") -const UINT D3D11_DEFAULT_MAX_ANISOTROPY = 16; -cpp_quote("#define D3D11_DEFAULT_MIP_LOD_BIAS 0.0f") -const UINT D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX = 0; -const UINT D3D11_DEFAULT_SAMPLE_MASK = 0xffffffff; -const UINT D3D11_DEFAULT_SCISSOR_ENDX = 0; -const UINT D3D11_DEFAULT_SCISSOR_ENDY = 0; -const UINT D3D11_DEFAULT_SCISSOR_STARTX = 0; -const UINT D3D11_DEFAULT_SCISSOR_STARTY = 0; -cpp_quote("#define D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS 0.0f") -const UINT D3D11_DEFAULT_STENCIL_READ_MASK = 0xff; -const UINT D3D11_DEFAULT_STENCIL_REFERENCE = 0; -const UINT D3D11_DEFAULT_STENCIL_WRITE_MASK = 0xff; -const UINT D3D11_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX = 0; -const UINT D3D11_DEFAULT_VIEWPORT_HEIGHT = 0; -cpp_quote("#define D3D11_DEFAULT_VIEWPORT_MAX_DEPTH 0.0f") -cpp_quote("#define D3D11_DEFAULT_VIEWPORT_MIN_DEPTH 0.0f") -const UINT D3D11_DEFAULT_VIEWPORT_TOPLEFTX = 0; -const UINT D3D11_DEFAULT_VIEWPORT_TOPLEFTY = 0; -const UINT D3D11_DEFAULT_VIEWPORT_WIDTH = 0; - -cpp_quote("#define D3D11_FLOAT32_MAX (3.402823466e+38f)") - -const UINT D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32; - -const unsigned int D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; - -const UINT D3D11_MAX_MAXANISOTROPY = 16; -const UINT D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT = 32; -const UINT D3D11_VIEWPORT_BOUNDS_MAX = 32767; -const INT D3D11_VIEWPORT_BOUNDS_MIN = -32768; -const UINT D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15; -const UINT D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16; - -const UINT D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL = 0xffffffff; -const UINT D3D11_KEEP_UNORDERED_ACCESS_VIEWS = 0xffffffff; - -const UINT D3D11_SHADER_MAJOR_VERSION = 5; -const UINT D3D11_SHADER_MAX_INSTANCES = 65535; -const UINT D3D11_SHADER_MAX_INTERFACES = 253; -const UINT D3D11_SHADER_MAX_INTERFACE_CALL_SITES = 4096; -const UINT D3D11_SHADER_MAX_TYPES = 65535; -const UINT D3D11_SHADER_MINOR_VERSION = 0; -const UINT D3D11_VS_OUTPUT_REGISTER_COUNT = 32; - -const UINT D3D11_OMAC_SIZE = 16; - -const UINT D3D11_PS_CS_UAV_REGISTER_COMPONENTS = 1; -const UINT D3D11_PS_CS_UAV_REGISTER_COUNT = 8; -const UINT D3D11_PS_CS_UAV_REGISTER_READS_PER_INST = 1; -const UINT D3D11_PS_CS_UAV_REGISTER_READ_PORTS = 1; -const UINT D3D11_PS_FRONTFACING_DEFAULT_VALUE = 0xffffffff; -const UINT D3D11_PS_FRONTFACING_FALSE_VALUE = 0; -const UINT D3D11_PS_FRONTFACING_TRUE_VALUE = 0xffffffff; -const UINT D3D11_PS_INPUT_REGISTER_COMPONENTS = 4; -const UINT D3D11_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_PS_INPUT_REGISTER_COUNT = 32; -const UINT D3D11_PS_INPUT_REGISTER_READS_PER_INST = 2; -const UINT D3D11_PS_INPUT_REGISTER_READ_PORTS = 1; -cpp_quote("#define D3D11_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT (0.0f)") -const UINT D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS = 1; -const UINT D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_PS_OUTPUT_DEPTH_REGISTER_COUNT = 1; -const UINT D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENTS = 1; -const UINT D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_PS_OUTPUT_MASK_REGISTER_COUNT = 1; -const UINT D3D11_PS_OUTPUT_REGISTER_COMPONENTS = 4; -const UINT D3D11_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_PS_OUTPUT_REGISTER_COUNT = 8; -cpp_quote("#define D3D11_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT (0.5f)") - -const UINT D3D11_RAW_UAV_SRV_BYTE_ALIGNMENT = 16; - -const UINT D3D11_REQ_BLEND_OBJECT_COUNT_PER_DEVICE = 4096; -const UINT D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP = 27; -const UINT D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; -const UINT D3D11_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE = 4096; -const UINT D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 32; -const UINT D3D11_REQ_DRAW_VERTEX_COUNT_2_TO_EXP = 32; -const UINT D3D11_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION = 16384; -const UINT D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT = 1024; -const UINT D3D11_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; -const UINT D3D11_REQ_MAXANISOTROPY = 16; -const UINT D3D11_REQ_MIP_LEVELS = 15; -const UINT D3D11_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES = 2048; -const UINT D3D11_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE = 4096; -const UINT D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH = 16384; -const UINT D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM = 128; -cpp_quote("#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM (0.25f)") -const UINT D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM = 2048; -const UINT D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP = 20; -const UINT D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE = 4096; -const UINT D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = 2048; -const UINT D3D11_REQ_TEXTURE1D_U_DIMENSION = 16384; -const UINT D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = 2048; -const UINT D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384; -const UINT D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048; -const UINT D3D11_REQ_TEXTURECUBE_DIMENSION = 16384; - -const UINT D3D11_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = 0; - -const UINT D3D11_SHIFT_INSTRUCTION_PAD_VALUE = 0; -const UINT D3D11_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT = 5; - -const UINT D3D11_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048; -const UINT D3D11_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 512; -const UINT D3D11_SO_BUFFER_SLOT_COUNT = 4; -const UINT D3D11_SO_DDI_REGISTER_INDEX_DENOTING_GAP = 0xffffffff; -const UINT D3D11_SO_NO_RASTERIZED_STREAM = 0xffffffff; -const UINT D3D11_SO_OUTPUT_COMPONENT_COUNT = 128; -const UINT D3D11_SO_STREAM_COUNT = 4; - -const UINT D3D11_SPEC_DATE_DAY = 16; -const UINT D3D11_SPEC_DATE_MONTH = 05; -const UINT D3D11_SPEC_DATE_YEAR = 2011; - -cpp_quote("#define D3D11_SPEC_VERSION (1.07)") -cpp_quote("#define D3D11_SRGB_GAMMA (2.2f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_1 (12.92f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_2 (1.055f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_EXPONENT (2.4f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_OFFSET (0.055f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_THRESHOLD (0.04045f)") -cpp_quote("#define D3D11_SRGB_TO_FLOAT_TOLERANCE_IN_ULP (0.5f)") - -const UINT D3D11_STANDARD_COMPONENT_BIT_COUNT = 32; -const UINT D3D11_STANDARD_COMPONENT_BIT_COUNT_DOUBLED = 64; -const UINT D3D11_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = 4; -const UINT D3D11_STANDARD_PIXEL_COMPONENT_COUNT = 128; -const UINT D3D11_STANDARD_PIXEL_ELEMENT_COUNT = 32; -const UINT D3D11_STANDARD_VECTOR_SIZE = 4; -const UINT D3D11_STANDARD_VERTEX_ELEMENT_COUNT = 32; -const UINT D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = 64; - -cpp_quote("#endif") - -cpp_quote("#ifndef _D3D11_1_CONSTANTS") -cpp_quote("#define _D3D11_1_CONSTANTS") -const UINT D3D11_1_UAV_SLOT_COUNT = 64; -cpp_quote("#endif") - -cpp_quote("#ifndef _D3D11_2_CONSTANTS") -cpp_quote("#define _D3D11_2_CONSTANTS") -const UINT D3D11_2_TILED_RESOURCE_TILE_SIZE_IN_BYTES = 0x10000; -cpp_quote("#endif") - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_DEFAULT {};") -cpp_quote("extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT;") -cpp_quote("#endif") - -typedef enum D3D11_BLEND -{ - D3D11_BLEND_ZERO = 1, - D3D11_BLEND_ONE = 2, - D3D11_BLEND_SRC_COLOR = 3, - D3D11_BLEND_INV_SRC_COLOR = 4, - D3D11_BLEND_SRC_ALPHA = 5, - D3D11_BLEND_INV_SRC_ALPHA = 6, - D3D11_BLEND_DEST_ALPHA = 7, - D3D11_BLEND_INV_DEST_ALPHA = 8, - D3D11_BLEND_DEST_COLOR = 9, - D3D11_BLEND_INV_DEST_COLOR = 10, - D3D11_BLEND_SRC_ALPHA_SAT = 11, - D3D11_BLEND_BLEND_FACTOR = 14, - D3D11_BLEND_INV_BLEND_FACTOR = 15, - D3D11_BLEND_SRC1_COLOR = 16, - D3D11_BLEND_INV_SRC1_COLOR = 17, - D3D11_BLEND_SRC1_ALPHA = 18, - D3D11_BLEND_INV_SRC1_ALPHA = 19, -} D3D11_BLEND; - -typedef enum D3D11_BLEND_OP -{ - D3D11_BLEND_OP_ADD = 1, - D3D11_BLEND_OP_SUBTRACT, - D3D11_BLEND_OP_REV_SUBTRACT, - D3D11_BLEND_OP_MIN, - D3D11_BLEND_OP_MAX -} D3D11_BLEND_OP; - -typedef enum D3D11_VIDEO_DECODER_BUFFER_TYPE -{ - D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0, - D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL = 1, - D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE = 2, - D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL = 3, - D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX = 4, - D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL = 5, - D3D11_VIDEO_DECODER_BUFFER_BITSTREAM = 6, - D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR = 7, - D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN = 8, -} D3D11_VIDEO_DECODER_BUFFER_TYPE; - -typedef enum D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE -{ - D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_OPAQUE = 0, - D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_BACKGROUND = 1, - D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_DESTINATION = 2, - D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_SOURCE_STREAM = 3, -} D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE; - -typedef enum D3D11_VIDEO_PROCESSOR_OUTPUT_RATE -{ - D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_NORMAL = 0, - D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_HALF = 1, - D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_CUSTOM = 2, -} D3D11_VIDEO_PROCESSOR_OUTPUT_RATE; - -typedef enum D3D11_VIDEO_PROCESSOR_STEREO_FORMAT -{ - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO = 0, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_HORIZONTAL = 1, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_VERTICAL = 2, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_SEPARATE = 3, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO_OFFSET = 4, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_ROW_INTERLEAVED = 5, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_COLUMN_INTERLEAVED = 6, - D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_CHECKERBOARD = 7, -} D3D11_VIDEO_PROCESSOR_STEREO_FORMAT; - -typedef enum D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE -{ - D3D11_VIDEO_PROCESSOR_STEREO_FLIP_NONE = 0, - D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME0 = 1, - D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME1 = 2, -} D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE; - -typedef enum D3D11_VIDEO_PROCESSOR_ROTATION -{ - D3D11_VIDEO_PROCESSOR_ROTATION_IDENTITY = 0, - D3D11_VIDEO_PROCESSOR_ROTATION_90 = 1, - D3D11_VIDEO_PROCESSOR_ROTATION_180 = 2, - D3D11_VIDEO_PROCESSOR_ROTATION_270 = 3, -} D3D11_VIDEO_PROCESSOR_ROTATION; - -typedef enum D3D11_VIDEO_PROCESSOR_DEVICE_CAPS -{ - D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_LINEAR_SPACE = 0x00000001, - D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_xvYCC = 0x00000002, - D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_RGB_RANGE_CONVERSION = 0x00000004, - D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION = 0x00000008, - D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_NOMINAL_RANGE = 0x00000010, -} D3D11_VIDEO_PROCESSOR_DEVICE_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_FEATURE_CAPS -{ - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_FILL = 0x00000001, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_CONSTRICTION = 0x00000002, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LUMA_KEY = 0x00000004, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_PALETTE = 0x00000008, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LEGACY = 0x00000010, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_STEREO = 0x00000020, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ROTATION = 0x00000040, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_STREAM = 0x00000080, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_PIXEL_ASPECT_RATIO = 0x00000100, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_MIRROR = 0x00000200, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x00000400, - D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_METADATA_HDR10 = 0x00000800, -} D3D11_VIDEO_PROCESSOR_FEATURE_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_FILTER_CAPS -{ - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS = 0x00000001, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST = 0x00000002, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_HUE = 0x00000004, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_SATURATION = 0x00000008, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_NOISE_REDUCTION = 0x00000010, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_EDGE_ENHANCEMENT = 0x00000020, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_ANAMORPHIC_SCALING = 0x00000040, - D3D11_VIDEO_PROCESSOR_FILTER_CAPS_STEREO_ADJUSTMENT = 0x00000080, -} D3D11_VIDEO_PROCESSOR_FILTER_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_FORMAT_CAPS -{ - D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_INTERLACED = 0x00000001, - D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_PROCAMP = 0x00000002, - D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_LUMA_KEY = 0x00000004, - D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_PALETTE_INTERLACED = 0x00000008, -} D3D11_VIDEO_PROCESSOR_FORMAT_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS -{ - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DENOISE = 0x00000001, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DERINGING = 0x00000002, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT = 0x00000004, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_COLOR_CORRECTION = 0x00000008, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING = 0x00000010, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_IMAGE_STABILIZATION = 0x00000020, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_SUPER_RESOLUTION = 0x00000040, - D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING = 0x00000080, -} D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_STEREO_CAPS -{ - D3D11_VIDEO_PROCESSOR_STEREO_CAPS_MONO_OFFSET = 0x00000001, - D3D11_VIDEO_PROCESSOR_STEREO_CAPS_ROW_INTERLEAVED = 0x00000002, - D3D11_VIDEO_PROCESSOR_STEREO_CAPS_COLUMN_INTERLEAVED = 0x00000004, - D3D11_VIDEO_PROCESSOR_STEREO_CAPS_CHECKERBOARD = 0x00000008, - D3D11_VIDEO_PROCESSOR_STEREO_CAPS_FLIP_MODE = 0x00000010, -} D3D11_VIDEO_PROCESSOR_STEREO_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS -{ - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND = 0x01, - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB = 0x02, - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE = 0x04, - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION = 0x08, - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE = 0x10, - D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION = 0x20, -} D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS -{ - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32 = 0x00000001, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_22 = 0x00000002, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2224 = 0x00000004, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2332 = 0x00000008, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32322 = 0x00000010, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_55 = 0x00000020, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_64 = 0x00000040, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_87 = 0x00000080, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_222222222223 = 0x00000100, - D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_OTHER = 0x80000000, -} D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS; - -typedef enum D3D11_CONTENT_PROTECTION_CAPS -{ - D3D11_CONTENT_PROTECTION_CAPS_SOFTWARE = 0x00000001, - D3D11_CONTENT_PROTECTION_CAPS_HARDWARE = 0x00000002, - D3D11_CONTENT_PROTECTION_CAPS_PROTECTION_ALWAYS_ON = 0x00000004, - D3D11_CONTENT_PROTECTION_CAPS_PARTIAL_DECRYPTION = 0x00000008, - D3D11_CONTENT_PROTECTION_CAPS_CONTENT_KEY = 0x00000010, - D3D11_CONTENT_PROTECTION_CAPS_FRESHEN_SESSION_KEY = 0x00000020, - D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK = 0x00000040, - D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK_KEY = 0x00000080, - D3D11_CONTENT_PROTECTION_CAPS_SEQUENTIAL_CTR_IV = 0x00000100, - D3D11_CONTENT_PROTECTION_CAPS_ENCRYPT_SLICEDATA_ONLY = 0x00000200, - D3D11_CONTENT_PROTECTION_CAPS_DECRYPTION_BLT = 0x00000400, - D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECT_UNCOMPRESSED = 0x00000800, - D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECTED_MEMORY_PAGEABLE = 0x00001000, - D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_TEARDOWN = 0x00002000, - D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_DRM_COMMUNICATION = 0x00004000, -} D3D11_CONTENT_PROTECTION_CAPS; - -typedef enum D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE -{ - D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_UNDEFINED = 0x00000000, - D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 = 0x00000001, - D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255 = 0x00000002, -} D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE; - -typedef enum D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE -{ - D3D11_PROCESSIDTYPE_UNKNOWN = 0x00000000, - D3D11_PROCESSIDTYPE_DWM = 0x00000001, - D3D11_PROCESSIDTYPE_HANDLE = 0x00000002, -} D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE; - -typedef enum D3D11_BUS_TYPE -{ - D3D11_BUS_TYPE_OTHER = 0x00000000, - D3D11_BUS_TYPE_PCI = 0x00000001, - D3D11_BUS_TYPE_PCIX = 0x00000002, - D3D11_BUS_TYPE_PCIEXPRESS = 0x00000003, - D3D11_BUS_TYPE_AGP = 0x00000004, - D3D11_BUS_IMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x00010000, - D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x00020000, - D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000, - D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000, - D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000, - D3D11_BUS_IMPL_MODIFIER_NON_STANDARD = 0x80000000, -} D3D11_BUS_TYPE; - -typedef struct D3D11_BOX -{ - UINT left; - UINT top; - UINT front; - UINT right; - UINT bottom; - UINT back; -} D3D11_BOX; - -typedef struct D3D11_BUFFER_RTV -{ - union - { - UINT FirstElement; - UINT ElementOffset; - }; - union - { - UINT NumElements; - UINT ElementWidth; - }; -} D3D11_BUFFER_RTV; - -typedef struct D3D11_BUFFER_SRV -{ - union - { - UINT FirstElement; - UINT ElementOffset; - }; - union - { - UINT NumElements; - UINT ElementWidth; - }; -} D3D11_BUFFER_SRV; - -typedef struct D3D11_BUFFER_UAV -{ - UINT FirstElement; - UINT NumElements; - UINT Flags; -} D3D11_BUFFER_UAV; - -typedef struct D3D11_BUFFEREX_SRV -{ - UINT FirstElement; - UINT NumElements; - UINT Flags; -} D3D11_BUFFEREX_SRV; - -typedef struct D3D11_CLASS_INSTANCE_DESC -{ - UINT InstanceId; - UINT InstanceIndex; - UINT TypeId; - UINT ConstantBuffer; - UINT BaseConstantBufferOffset; - UINT BaseTexture; - UINT BaseSampler; - BOOL Created; -} D3D11_CLASS_INSTANCE_DESC; - -typedef enum D3D11_COMPARISON_FUNC -{ - D3D11_COMPARISON_NEVER = 1, - D3D11_COMPARISON_LESS, - D3D11_COMPARISON_EQUAL, - D3D11_COMPARISON_LESS_EQUAL, - D3D11_COMPARISON_GREATER, - D3D11_COMPARISON_NOT_EQUAL, - D3D11_COMPARISON_GREATER_EQUAL, - D3D11_COMPARISON_ALWAYS -} D3D11_COMPARISON_FUNC; - -typedef enum D3D11_COUNTER -{ - D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000, -} D3D11_COUNTER; - -typedef struct D3D11_COUNTER_DESC -{ - D3D11_COUNTER Counter; - UINT MiscFlags; -} D3D11_COUNTER_DESC; - -typedef struct D3D11_COUNTER_INFO -{ - D3D11_COUNTER LastDeviceDependentCounter; - UINT NumSimultaneousCounters; - UINT8 NumDetectableParallelUnits; -} D3D11_COUNTER_INFO; - -typedef enum D3D11_COUNTER_TYPE -{ - D3D11_COUNTER_TYPE_FLOAT32, - D3D11_COUNTER_TYPE_UINT16, - D3D11_COUNTER_TYPE_UINT32, - D3D11_COUNTER_TYPE_UINT64, -} D3D11_COUNTER_TYPE; - -typedef enum D3D11_CULL_MODE -{ - D3D11_CULL_NONE = 1, - D3D11_CULL_FRONT, - D3D11_CULL_BACK -} D3D11_CULL_MODE; - -typedef enum D3D11_DEPTH_WRITE_MASK -{ - D3D11_DEPTH_WRITE_MASK_ZERO, - D3D11_DEPTH_WRITE_MASK_ALL, -} D3D11_DEPTH_WRITE_MASK; - -typedef enum D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS -{ - D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, - D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe, -} D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS; - -typedef enum D3D11_DEVICE_CONTEXT_TYPE -{ - D3D11_DEVICE_CONTEXT_IMMEDIATE, - D3D11_DEVICE_CONTEXT_DEFERRED, -} D3D11_DEVICE_CONTEXT_TYPE; - -typedef enum D3D11_DSV_DIMENSION -{ - D3D11_DSV_DIMENSION_UNKNOWN, - D3D11_DSV_DIMENSION_TEXTURE1D, - D3D11_DSV_DIMENSION_TEXTURE1DARRAY, - D3D11_DSV_DIMENSION_TEXTURE2D, - D3D11_DSV_DIMENSION_TEXTURE2DARRAY, - D3D11_DSV_DIMENSION_TEXTURE2DMS, - D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY, -} D3D11_DSV_DIMENSION; - -typedef enum D3D11_FEATURE -{ - D3D11_FEATURE_THREADING, - D3D11_FEATURE_DOUBLES, - D3D11_FEATURE_FORMAT_SUPPORT, - D3D11_FEATURE_FORMAT_SUPPORT2, - D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, - D3D11_FEATURE_D3D11_OPTIONS, - D3D11_FEATURE_ARCHITECTURE_INFO, - D3D11_FEATURE_D3D9_OPTIONS, - D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT, - D3D11_FEATURE_D3D9_SHADOW_SUPPORT, - D3D11_FEATURE_D3D11_OPTIONS1, - D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT, - D3D11_FEATURE_MARKER_SUPPORT, - D3D11_FEATURE_D3D9_OPTIONS1, - D3D11_FEATURE_D3D11_OPTIONS2, - D3D11_FEATURE_D3D11_OPTIONS3, - D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT, - D3D11_FEATURE_D3D11_OPTIONS4, - D3D11_FEATURE_SHADER_CACHE, - D3D11_FEATURE_D3D11_OPTIONS5, -} D3D11_FEATURE; - -typedef struct D3D11_FEATURE_DATA_THREADING -{ - BOOL DriverConcurrentCreates; - BOOL DriverCommandLists; -} D3D11_FEATURE_DATA_THREADING; - -typedef struct D3D11_FEATURE_DATA_DOUBLES -{ - BOOL DoublePrecisionFloatShaderOps; -} D3D11_FEATURE_DATA_DOUBLES; - -typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT -{ - DXGI_FORMAT InFormat; - UINT OutFormatSupport; -} D3D11_FEATURE_DATA_FORMAT_SUPPORT; - -typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 -{ - DXGI_FORMAT InFormat; - UINT OutFormatSupport2; -} D3D11_FEATURE_DATA_FORMAT_SUPPORT2; - -typedef struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS -{ - BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; -} D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS; - -typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS -{ - BOOL OutputMergerLogicOp; - BOOL UAVOnlyRenderingForcedSampleCount; - BOOL DiscardAPIsSeenByDriver; - BOOL FlagsForUpdateAndCopySeenByDriver; - BOOL ClearView; - BOOL CopyWithOverlap; - BOOL ConstantBufferPartialUpdate; - BOOL ConstantBufferOffsetting; - BOOL MapNoOverwriteOnDynamicConstantBuffer; - BOOL MapNoOverwriteOnDynamicBufferSRV; - BOOL MultisampleRTVWithForcedSampleCountOne; - BOOL SAD4ShaderInstructions; - BOOL ExtendedDoublesShaderInstructions; - BOOL ExtendedResourceSharing; -} D3D11_FEATURE_DATA_D3D11_OPTIONS; - -typedef struct D3D11_FEATURE_DATA_ARCHITECTURE_INFO -{ - BOOL TileBasedDeferredRenderer; -} D3D11_FEATURE_DATA_ARCHITECTURE_INFO; - -typedef struct D3D11_FEATURE_DATA_D3D9_OPTIONS -{ - BOOL FullNonPow2TextureSupport; -} D3D11_FEATURE_DATA_D3D9_OPTIONS; - -typedef struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT -{ - BOOL SupportsDepthAsTextureWithLessEqualComparisonFilter; -} D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT; - -typedef enum D3D11_SHADER_MIN_PRECISION_SUPPORT -{ - D3D11_SHADER_MIN_PRECISION_10_BIT = 0x1, - D3D11_SHADER_MIN_PRECISION_16_BIT = 0x2, -} D3D11_SHADER_MIN_PRECISION_SUPPORT; - -typedef struct D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT -{ - UINT PixelShaderMinPrecision; - UINT AllOtherShaderStagesMinPrecision; -} D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT; - -typedef enum D3D11_TILED_RESOURCES_TIER -{ - D3D11_TILED_RESOURCES_NOT_SUPPORTED = 0x0, - D3D11_TILED_RESOURCES_TIER_1 = 0x1, - D3D11_TILED_RESOURCES_TIER_2 = 0x2, - D3D11_TILED_RESOURCES_TIER_3 = 0x3, -} D3D11_TILED_RESOURCES_TIER; - -typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS1 -{ - D3D11_TILED_RESOURCES_TIER TiledResourcesTier; - BOOL MinMaxFiltering; - BOOL ClearViewAlsoSupportsDepthOnlyFormats; - BOOL MapOnDefaultBuffers; -} D3D11_FEATURE_DATA_D3D11_OPTIONS1; - -typedef struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT -{ - BOOL SimpleInstancingSupported; -} D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT; - -typedef struct D3D11_FEATURE_DATA_MARKER_SUPPORT -{ - BOOL Profile; -} D3D11_FEATURE_DATA_MARKER_SUPPORT; - -typedef struct D3D11_FEATURE_DATA_D3D9_OPTIONS1 -{ - BOOL FullNonPow2TextureSupported; - BOOL DepthAsTextureWithLessEqualComparisonFilterSupported; - BOOL SimpleInstancingSupported; - BOOL TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported; -} D3D11_FEATURE_DATA_D3D9_OPTIONS1; - -typedef enum D3D11_CONSERVATIVE_RASTERIZATION_TIER -{ - D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED = 0x0, - D3D11_CONSERVATIVE_RASTERIZATION_TIER_1 = 0x1, - D3D11_CONSERVATIVE_RASTERIZATION_TIER_2 = 0x2, - D3D11_CONSERVATIVE_RASTERIZATION_TIER_3 = 0x3, -} D3D11_CONSERVATIVE_RASTERIZATION_TIER; - -typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS2 -{ - BOOL PSSpecifiedStencilRefSupported; - BOOL TypedUAVLoadAdditionalFormats; - BOOL ROVsSupported; - D3D11_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier; - D3D11_TILED_RESOURCES_TIER TiledResourcesTier; - BOOL MapOnDefaultTextures; - BOOL StandardSwizzle; - BOOL UnifiedMemoryArchitecture; -} D3D11_FEATURE_DATA_D3D11_OPTIONS2; - -typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS3 -{ - BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizer; -} D3D11_FEATURE_DATA_D3D11_OPTIONS3; - -typedef struct D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT -{ - UINT MaxGPUVirtualAddressBitsPerResource; - UINT MaxGPUVirtualAddressBitsPerProcess; -} D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT; - -typedef enum D3D11_SHADER_CACHE_SUPPORT_FLAGS -{ - D3D11_SHADER_CACHE_SUPPORT_NONE = 0x0, - D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x1, - D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x2, -} D3D11_SHADER_CACHE_SUPPORT_FLAGS; - -typedef struct D3D11_FEATURE_DATA_SHADER_CACHE -{ - UINT SupportFlags; -} D3D11_FEATURE_DATA_SHADER_CACHE; - -typedef enum D3D11_SHARED_RESOURCE_TIER -{ - D3D11_SHARED_RESOURCE_TIER_0, - D3D11_SHARED_RESOURCE_TIER_1, - D3D11_SHARED_RESOURCE_TIER_2, - D3D11_SHARED_RESOURCE_TIER_3, -} D3D11_SHARED_RESOURCE_TIER; - -typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS5 -{ - D3D11_SHARED_RESOURCE_TIER SharedResourceTier; -} D3D11_FEATURE_DATA_D3D11_OPTIONS5; - -typedef enum D3D11_FILL_MODE -{ - D3D11_FILL_WIREFRAME = 2, - D3D11_FILL_SOLID -} D3D11_FILL_MODE; - -typedef enum D3D11_FILTER_TYPE -{ - D3D11_FILTER_TYPE_POINT = 0, - D3D11_FILTER_TYPE_LINEAR = 1 -} D3D11_FILTER_TYPE; - -const UINT D3D11_MIN_FILTER_SHIFT = 4; -const UINT D3D11_MAG_FILTER_SHIFT = 2; -const UINT D3D11_MIP_FILTER_SHIFT = 0; -const UINT D3D11_FILTER_TYPE_MASK = 0x00000003; -const UINT D3D11_COMPARISON_FILTERING_BIT = 0x00000080; -const UINT D3D11_ANISOTROPIC_FILTERING_BIT = 0x00000040; - -cpp_quote("#define D3D11_ENCODE_BASIC_FILTER(min, mag, mip, bComparison) \\") -cpp_quote(" ((D3D11_FILTER)(((bComparison) ? D3D11_COMPARISON_FILTERING_BIT : 0 ) | \\") -cpp_quote(" (((min)&D3D11_FILTER_TYPE_MASK) << D3D11_MIN_FILTER_SHIFT) | \\") -cpp_quote(" (((mag)&D3D11_FILTER_TYPE_MASK) << D3D11_MAG_FILTER_SHIFT) | \\") -cpp_quote(" (((mip)&D3D11_FILTER_TYPE_MASK) << D3D11_MIP_FILTER_SHIFT)))") - -cpp_quote("#define D3D11_ENCODE_ANISOTROPIC_FILTER(bComparison) \\") -cpp_quote(" ((D3D11_FILTER)(D3D11_ANISOTROPIC_FILTERING_BIT | \\" ) -cpp_quote(" D3D11_ENCODE_BASIC_FILTER(D3D11_FILTER_TYPE_LINEAR,D3D11_FILTER_TYPE_LINEAR, \\" ) -cpp_quote(" D3D11_FILTER_TYPE_LINEAR,bComparison)))" ) - -cpp_quote("#define D3D11_DECODE_MIN_FILTER(d3d11Filter) \\") -cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MIN_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") - -cpp_quote("#define D3D11_DECODE_MAG_FILTER(d3d11Filter) \\") -cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MAG_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") - -cpp_quote("#define D3D11_DECODE_MIP_FILTER(d3d11Filter) \\") -cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MIP_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") - -cpp_quote("#define D3D11_DECODE_IS_COMPARISON_FILTER(d3d11Filter) ((d3d11Filter) & D3D11_COMPARISON_FILTERING_BIT)") - -cpp_quote("#define D3D11_DECODE_IS_ANISOTROPIC_FILTER(d3d11Filter) \\") -cpp_quote(" (((d3d11Filter) & D3D11_ANISOTROPIC_FILTERING_BIT ) \\" ) -cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER(d3d11Filter)) \\" ) -cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MAG_FILTER(d3d11Filter)) \\" ) -cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER(d3d11Filter)))") - -typedef enum D3D11_FILTER -{ - D3D11_FILTER_MIN_MAG_MIP_POINT = 0x00, - D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01, - D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, - D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05, - D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, - D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, - D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, - D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15, - D3D11_FILTER_ANISOTROPIC = 0x55, - D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, - D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, - D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, - D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, - D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, - D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, - D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, - D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, - D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5, - D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, - D3D11_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, - D3D11_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104, - D3D11_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105, - D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110, - D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111, - D3D11_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114, - D3D11_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115, - D3D11_FILTER_MINIMUM_ANISOTROPIC = 0x155, - D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, - D3D11_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, - D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184, - D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185, - D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190, - D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191, - D3D11_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194, - D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195, - D3D11_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5 -} D3D11_FILTER; - -typedef enum D3D11_DSV_FLAG -{ - D3D11_DSV_READ_ONLY_DEPTH = 0x1, - D3D11_DSV_READ_ONLY_STENCIL = 0x2, -} D3D11_DSV_FLAG; - -typedef enum D3D11_BUFFEREX_SRV_FLAG -{ - D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1, -} D3D11_BUFFEREX_SRV_FLAG; - -typedef enum D3D11_UAV_FLAG -{ - D3D11_BUFFER_UAV_FLAG_RAW = 0x1, - D3D11_BUFFER_UAV_FLAG_APPEND = 0x2, - D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4, -} D3D11_UAV_FLAG; - -typedef enum D3D11_INPUT_CLASSIFICATION -{ - D3D11_INPUT_PER_VERTEX_DATA, - D3D11_INPUT_PER_INSTANCE_DATA, -} D3D11_INPUT_CLASSIFICATION; - -const UINT D3D11_APPEND_ALIGNED_ELEMENT = 0xffffffff; - -typedef struct D3D11_INPUT_ELEMENT_DESC -{ - LPCSTR SemanticName; - UINT SemanticIndex; - DXGI_FORMAT Format; - UINT InputSlot; - UINT AlignedByteOffset; - D3D11_INPUT_CLASSIFICATION InputSlotClass; - UINT InstanceDataStepRate; -} D3D11_INPUT_ELEMENT_DESC; - -typedef enum D3D11_MAP -{ - D3D11_MAP_READ = 1, - D3D11_MAP_WRITE, - D3D11_MAP_READ_WRITE, - D3D11_MAP_WRITE_DISCARD, - D3D11_MAP_WRITE_NO_OVERWRITE -} D3D11_MAP; - -typedef enum D3D11_MAP_FLAG -{ - D3D11_MAP_FLAG_DO_NOT_WAIT = 0x00100000 -} D3D11_MAP_FLAG; - -typedef enum D3D11_RAISE_FLAG -{ - D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1, -} D3D11_RAISE_FLAG; - -typedef struct D3D11_QUERY_DATA_SO_STATISTICS -{ - UINT64 NumPrimitivesWritten; - UINT64 PrimitivesStorageNeeded; -} D3D11_QUERY_DATA_SO_STATISTICS; - -typedef struct D3D11_MAPPED_SUBRESOURCE -{ - void *pData; - UINT RowPitch; - UINT DepthPitch; -} D3D11_MAPPED_SUBRESOURCE; - -typedef enum D3D11_QUERY -{ - D3D11_QUERY_EVENT, - D3D11_QUERY_OCCLUSION, - D3D11_QUERY_TIMESTAMP, - D3D11_QUERY_TIMESTAMP_DISJOINT, - D3D11_QUERY_PIPELINE_STATISTICS, - D3D11_QUERY_OCCLUSION_PREDICATE, - D3D11_QUERY_SO_STATISTICS, - D3D11_QUERY_SO_OVERFLOW_PREDICATE, - D3D11_QUERY_SO_STATISTICS_STREAM0, - D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, - D3D11_QUERY_SO_STATISTICS_STREAM1, - D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1, - D3D11_QUERY_SO_STATISTICS_STREAM2, - D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2, - D3D11_QUERY_SO_STATISTICS_STREAM3, - D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3, -} D3D11_QUERY; - -typedef enum D3D11_QUERY_MISC_FLAG -{ - D3D11_QUERY_MISC_PREDICATEHINT = 0x1, -} D3D11_QUERY_MISC_FLAG; - -typedef enum D3D11_ASYNC_GETDATA_FLAG -{ - D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x0001, -} D3D11_ASYNC_GETDATA_FLAG; - -typedef enum D3D11_RESOURCE_MISC_FLAG -{ - D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x00000001L, - D3D11_RESOURCE_MISC_SHARED = 0x00000002L, - D3D11_RESOURCE_MISC_TEXTURECUBE = 0x00000004L, - D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x00000010L, - D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x00000020L, - D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x00000040L, - D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x00000080L, - D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x00000100L, - D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x00000200L, - D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x00000800L, - D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x00001000L, - D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x00002000L, - D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x00004000L, - D3D11_RESOURCE_MISC_GUARDED = 0x00008000L, - D3D11_RESOURCE_MISC_TILE_POOL = 0x00020000L, - D3D11_RESOURCE_MISC_TILED = 0x00040000L, - D3D11_RESOURCE_MISC_HW_PROTECTED = 0x00080000L -} D3D11_RESOURCE_MISC_FLAG; - -typedef struct D3D11_QUERY_DESC -{ - D3D11_QUERY Query; - UINT MiscFlags; -} D3D11_QUERY_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_QUERY_DESC : public D3D11_QUERY_DESC {") -cpp_quote(" CD3D11_QUERY_DESC() {}") -cpp_quote(" ~CD3D11_QUERY_DESC() {}") -cpp_quote(" explicit CD3D11_QUERY_DESC(const D3D11_QUERY_DESC &other) : D3D11_QUERY_DESC(other) {}") -cpp_quote(" explicit CD3D11_QUERY_DESC(D3D11_QUERY query, UINT misc_flags = 0) {") -cpp_quote(" Query = query;") -cpp_quote(" MiscFlags = misc_flags;") -cpp_quote(" }") -cpp_quote(" operator const D3D11_QUERY_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D11_RASTERIZER_DESC -{ - D3D11_FILL_MODE FillMode; - D3D11_CULL_MODE CullMode; - BOOL FrontCounterClockwise; - INT DepthBias; - FLOAT DepthBiasClamp; - FLOAT SlopeScaledDepthBias; - BOOL DepthClipEnable; - BOOL ScissorEnable; - BOOL MultisampleEnable; - BOOL AntialiasedLineEnable; -} D3D11_RASTERIZER_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_RASTERIZER_DESC : public D3D11_RASTERIZER_DESC {") -cpp_quote(" CD3D11_RASTERIZER_DESC() {}") -cpp_quote(" explicit CD3D11_RASTERIZER_DESC(const D3D11_RASTERIZER_DESC &o) : D3D11_RASTERIZER_DESC(o) {}") -cpp_quote(" explicit CD3D11_RASTERIZER_DESC(CD3D11_DEFAULT) {") -cpp_quote(" FillMode = D3D11_FILL_SOLID;") -cpp_quote(" CullMode = D3D11_CULL_BACK;") -cpp_quote(" FrontCounterClockwise = FALSE;") -cpp_quote(" DepthBias = D3D11_DEFAULT_DEPTH_BIAS;") -cpp_quote(" DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;") -cpp_quote(" SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;") -cpp_quote(" DepthClipEnable = TRUE;") -cpp_quote(" ScissorEnable = FALSE;") -cpp_quote(" MultisampleEnable = FALSE;") -cpp_quote(" AntialiasedLineEnable = FALSE;") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_RASTERIZER_DESC(D3D11_FILL_MODE fillMode, D3D11_CULL_MODE cullMode," ) -cpp_quote(" BOOL frontCounterClockwise, INT depthBias, FLOAT depthBiasClamp, FLOAT slopeScaledDepthBias,") -cpp_quote(" BOOL depthClipEnable, BOOL scissorEnable, BOOL multisampleEnable, BOOL antialiasedLineEnable) {") -cpp_quote(" FillMode = fillMode;") -cpp_quote(" CullMode = cullMode;") -cpp_quote(" FrontCounterClockwise = frontCounterClockwise;") -cpp_quote(" DepthBias = depthBias;") -cpp_quote(" DepthBiasClamp = depthBiasClamp;") -cpp_quote(" SlopeScaledDepthBias = slopeScaledDepthBias;") -cpp_quote(" DepthClipEnable = depthClipEnable;") -cpp_quote(" ScissorEnable = scissorEnable;") -cpp_quote(" MultisampleEnable = multisampleEnable;") -cpp_quote(" AntialiasedLineEnable = antialiasedLineEnable;") -cpp_quote(" }") -cpp_quote(" ~CD3D11_RASTERIZER_DESC() {}") -cpp_quote(" operator const D3D11_RASTERIZER_DESC&() const { return *this; }") -cpp_quote("};") -cpp_quote("#endif") - -typedef enum D3D11_RESOURCE_DIMENSION -{ - D3D11_RESOURCE_DIMENSION_UNKNOWN, - D3D11_RESOURCE_DIMENSION_BUFFER, - D3D11_RESOURCE_DIMENSION_TEXTURE1D, - D3D11_RESOURCE_DIMENSION_TEXTURE2D, - D3D11_RESOURCE_DIMENSION_TEXTURE3D, -} D3D11_RESOURCE_DIMENSION; - -typedef enum D3D11_RTV_DIMENSION -{ - D3D11_RTV_DIMENSION_UNKNOWN, - D3D11_RTV_DIMENSION_BUFFER, - D3D11_RTV_DIMENSION_TEXTURE1D, - D3D11_RTV_DIMENSION_TEXTURE1DARRAY, - D3D11_RTV_DIMENSION_TEXTURE2D, - D3D11_RTV_DIMENSION_TEXTURE2DARRAY, - D3D11_RTV_DIMENSION_TEXTURE2DMS, - D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY, - D3D11_RTV_DIMENSION_TEXTURE3D, -} D3D11_RTV_DIMENSION; - -typedef struct D3D11_SO_DECLARATION_ENTRY -{ - UINT Stream; - LPCSTR SemanticName; - UINT SemanticIndex; - BYTE StartComponent; - BYTE ComponentCount; - BYTE OutputSlot; -} D3D11_SO_DECLARATION_ENTRY; - -typedef enum D3D11_STENCIL_OP -{ - D3D11_STENCIL_OP_KEEP = 1, - D3D11_STENCIL_OP_ZERO, - D3D11_STENCIL_OP_REPLACE, - D3D11_STENCIL_OP_INCR_SAT, - D3D11_STENCIL_OP_DECR_SAT, - D3D11_STENCIL_OP_INVERT, - D3D11_STENCIL_OP_INCR, - D3D11_STENCIL_OP_DECR -} D3D11_STENCIL_OP; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("}") -cpp_quote("inline UINT D3D11CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT MipLevels) {") -cpp_quote(" return MipSlice + ArraySlice * MipLevels;") -cpp_quote("}") -cpp_quote("extern \"C\"{") -cpp_quote("#endif") - -typedef struct D3D11_SUBRESOURCE_DATA -{ - const void *pSysMem; - UINT SysMemPitch; - UINT SysMemSlicePitch; -} D3D11_SUBRESOURCE_DATA; - -typedef struct D3D11_TEX1D_ARRAY_DSV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX1D_ARRAY_DSV; - -typedef struct D3D11_TEX1D_ARRAY_RTV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX1D_ARRAY_RTV; - -typedef struct D3D11_TEX1D_ARRAY_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX1D_ARRAY_SRV; - -typedef struct D3D11_TEX1D_ARRAY_UAV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX1D_ARRAY_UAV; - -typedef struct D3D11_TEX1D_DSV -{ - UINT MipSlice; -} D3D11_TEX1D_DSV; - -typedef struct D3D11_TEX1D_RTV -{ - UINT MipSlice; -} D3D11_TEX1D_RTV; - -typedef struct D3D11_TEX1D_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; - } D3D11_TEX1D_SRV; - -typedef struct D3D11_TEX1D_UAV -{ - UINT MipSlice; -} D3D11_TEX1D_UAV; - -typedef struct D3D11_TEX2D_ARRAY_DSV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2D_ARRAY_DSV; - -typedef struct D3D11_TEX2D_ARRAY_RTV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2D_ARRAY_RTV; - -typedef struct D3D11_TEX2D_ARRAY_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2D_ARRAY_SRV; - -typedef struct D3D11_TEX2D_ARRAY_UAV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2D_ARRAY_UAV; - -typedef struct D3D11_TEX2D_DSV -{ - UINT MipSlice; -} D3D11_TEX2D_DSV; - -typedef struct D3D11_TEX2D_RTV -{ - UINT MipSlice; -} D3D11_TEX2D_RTV; - -typedef struct D3D11_TEX2D_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; -} D3D11_TEX2D_SRV; - -typedef struct D3D11_TEX2D_UAV -{ - UINT MipSlice; -} D3D11_TEX2D_UAV; - -typedef struct D3D11_TEX2DMS_ARRAY_DSV -{ - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2DMS_ARRAY_DSV; - -typedef struct D3D11_TEX2DMS_ARRAY_RTV -{ - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2DMS_ARRAY_RTV; - -typedef struct D3D11_TEX2DMS_ARRAY_SRV -{ - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2DMS_ARRAY_SRV; - -typedef struct D3D11_TEX2DMS_DSV -{ - UINT UnusedField_NothingToDefine; -} D3D11_TEX2DMS_DSV; - -typedef struct D3D11_TEX2DMS_RTV -{ - UINT UnusedField_NothingToDefine; -} D3D11_TEX2DMS_RTV; - -typedef struct D3D11_TEX2DMS_SRV -{ - UINT UnusedField_NothingToDefine; -} D3D11_TEX2DMS_SRV; - -typedef struct D3D11_TEX3D_RTV -{ - UINT MipSlice; - UINT FirstWSlice; - UINT WSize; -} D3D11_TEX3D_RTV; - -typedef struct D3D11_TEX3D_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; -} D3D11_TEX3D_SRV; - -typedef struct D3D11_TEX3D_UAV -{ - UINT MipSlice; - UINT FirstWSlice; - UINT WSize; -} D3D11_TEX3D_UAV; - -typedef struct D3D11_TEXCUBE_ARRAY_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; - UINT First2DArrayFace; - UINT NumCubes; -} D3D11_TEXCUBE_ARRAY_SRV; - -typedef struct D3D11_TEXCUBE_SRV -{ - UINT MostDetailedMip; - UINT MipLevels; -} D3D11_TEXCUBE_SRV; - -typedef enum D3D11_TEXTURE_ADDRESS_MODE -{ - D3D11_TEXTURE_ADDRESS_WRAP = 1, - D3D11_TEXTURE_ADDRESS_MIRROR, - D3D11_TEXTURE_ADDRESS_CLAMP, - D3D11_TEXTURE_ADDRESS_BORDER, - D3D11_TEXTURE_ADDRESS_MIRROR_ONCE -} D3D11_TEXTURE_ADDRESS_MODE; - -typedef enum D3D11_UAV_DIMENSION -{ - D3D11_UAV_DIMENSION_UNKNOWN, - D3D11_UAV_DIMENSION_BUFFER, - D3D11_UAV_DIMENSION_TEXTURE1D, - D3D11_UAV_DIMENSION_TEXTURE1DARRAY, - D3D11_UAV_DIMENSION_TEXTURE2D, - D3D11_UAV_DIMENSION_TEXTURE2DARRAY, - D3D11_UAV_DIMENSION_TEXTURE3D = 8, -} D3D11_UAV_DIMENSION; - -typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC -{ - DXGI_FORMAT Format; - D3D11_UAV_DIMENSION ViewDimension; - - union - { - D3D11_BUFFER_UAV Buffer; - D3D11_TEX1D_UAV Texture1D; - D3D11_TEX1D_ARRAY_UAV Texture1DArray; - D3D11_TEX2D_UAV Texture2D; - D3D11_TEX2D_ARRAY_UAV Texture2DArray; - D3D11_TEX3D_UAV Texture3D; - }; -} D3D11_UNORDERED_ACCESS_VIEW_DESC; - -typedef enum D3D11_USAGE -{ - D3D11_USAGE_DEFAULT, - D3D11_USAGE_IMMUTABLE, - D3D11_USAGE_DYNAMIC, - D3D11_USAGE_STAGING, -} D3D11_USAGE; - -typedef enum D3D11_BIND_FLAG -{ - D3D11_BIND_VERTEX_BUFFER = 0x0001, - D3D11_BIND_INDEX_BUFFER = 0x0002, - D3D11_BIND_CONSTANT_BUFFER = 0x0004, - D3D11_BIND_SHADER_RESOURCE = 0x0008, - D3D11_BIND_STREAM_OUTPUT = 0x0010, - D3D11_BIND_RENDER_TARGET = 0x0020, - D3D11_BIND_DEPTH_STENCIL = 0x0040, - D3D11_BIND_UNORDERED_ACCESS = 0x0080, - D3D11_BIND_DECODER = 0x0200, - D3D11_BIND_VIDEO_ENCODER = 0x0400 -} D3D11_BIND_FLAG; - -typedef enum D3D11_CPU_ACCESS_FLAG -{ - D3D11_CPU_ACCESS_WRITE = 0x00010000, - D3D11_CPU_ACCESS_READ = 0x00020000 -} D3D11_CPU_ACCESS_FLAG; - -typedef struct D3D11_VIEWPORT -{ - FLOAT TopLeftX; - FLOAT TopLeftY; - FLOAT Width; - FLOAT Height; - FLOAT MinDepth; - FLOAT MaxDepth; -} D3D11_VIEWPORT; - -typedef enum D3D11_COLOR_WRITE_ENABLE -{ - D3D11_COLOR_WRITE_ENABLE_RED = 1, - D3D11_COLOR_WRITE_ENABLE_GREEN = 2, - D3D11_COLOR_WRITE_ENABLE_BLUE = 4, - D3D11_COLOR_WRITE_ENABLE_ALPHA = 8, - D3D11_COLOR_WRITE_ENABLE_ALL = - (D3D11_COLOR_WRITE_ENABLE_RED|D3D11_COLOR_WRITE_ENABLE_GREEN|D3D11_COLOR_WRITE_ENABLE_BLUE|D3D11_COLOR_WRITE_ENABLE_ALPHA) -} D3D11_COLOR_WRITE_ENABLE; - -typedef enum D3D11_FORMAT_SUPPORT -{ - D3D11_FORMAT_SUPPORT_BUFFER = 0x00000001, - D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x00000002, - D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x00000004, - D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x00000008, - D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x00000010, - D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x00000020, - D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x00000040, - D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x00000080, - D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x00000100, - D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x00000200, - D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x00000400, - D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x00000800, - D3D11_FORMAT_SUPPORT_MIP = 0x00001000, - D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x00002000, - D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x00004000, - D3D11_FORMAT_SUPPORT_BLENDABLE = 0x00008000, - D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x00010000, - D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x00020000, - D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x00040000, - D3D11_FORMAT_SUPPORT_DISPLAY = 0x00080000, - D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x00100000, - D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x00200000, - D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x00400000, - D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x00800000, - D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x01000000, - D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x02000000, - D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x04000000, - D3D11_FORMAT_SUPPORT_DECODER_OUTPUT = 0x08000000, - D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT = 0x10000000, - D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT = 0x20000000, - D3D11_FORMAT_SUPPORT_VIDEO_ENCODER = 0x40000000, -} D3D11_FORMAT_SUPPORT; - -typedef enum D3D11_FORMAT_SUPPORT2 -{ - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x00000001, - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x00000002, - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x00000004, - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x00000008, - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x00000010, - D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x00000020, - D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x00000040, - D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x00000080, - D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x00000100, - D3D11_FORMAT_SUPPORT2_TILED = 0x00000200, - D3D11_FORMAT_SUPPORT2_SHAREABLE = 0x00000400, - D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x00004000, -} D3D11_FORMAT_SUPPORT2; - -typedef enum D3D11_CLEAR_FLAG -{ - D3D11_CLEAR_DEPTH = 0x0001L, - D3D11_CLEAR_STENCIL = 0x0002L -} D3D11_CLEAR_FLAG; - -typedef struct D3D11_RENDER_TARGET_BLEND_DESC -{ - BOOL BlendEnable; - D3D11_BLEND SrcBlend; - D3D11_BLEND DestBlend; - D3D11_BLEND_OP BlendOp; - D3D11_BLEND SrcBlendAlpha; - D3D11_BLEND DestBlendAlpha; - D3D11_BLEND_OP BlendOpAlpha; - UINT8 RenderTargetWriteMask; -} D3D11_RENDER_TARGET_BLEND_DESC; - -typedef struct D3D11_BLEND_DESC -{ - BOOL AlphaToCoverageEnable; - BOOL IndependentBlendEnable; - D3D11_RENDER_TARGET_BLEND_DESC RenderTarget[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT]; -} D3D11_BLEND_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_BLEND_DESC : public D3D11_BLEND_DESC {") -cpp_quote(" CD3D11_BLEND_DESC() {}") -cpp_quote(" explicit CD3D11_BLEND_DESC(const D3D11_BLEND_DESC &o) : D3D11_BLEND_DESC(o) {}") -cpp_quote(" explicit CD3D11_BLEND_DESC(CD3D11_DEFAULT) {") -cpp_quote(" AlphaToCoverageEnable = FALSE;") -cpp_quote(" IndependentBlendEnable = FALSE;") -cpp_quote(" for(D3D11_RENDER_TARGET_BLEND_DESC *target = RenderTarget;") -cpp_quote(" target < RenderTarget + D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT;") -cpp_quote(" target++) {") -cpp_quote(" target->BlendEnable = FALSE;") -cpp_quote(" target->SrcBlend = target->SrcBlendAlpha = D3D11_BLEND_ONE;") -cpp_quote(" target->DestBlend = target->DestBlendAlpha = D3D11_BLEND_ZERO;") -cpp_quote(" target->BlendOp = target->BlendOpAlpha = D3D11_BLEND_OP_ADD;") -cpp_quote(" target->RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;") -cpp_quote(" }") -cpp_quote(" }") -cpp_quote(" ~CD3D11_BLEND_DESC() {}") -cpp_quote(" operator const D3D11_BLEND_DESC&() const { return *this; }") -cpp_quote("};" ) -cpp_quote("#endif" ) - -typedef struct D3D11_BUFFER_DESC -{ - UINT ByteWidth; - D3D11_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; - UINT StructureByteStride; -} D3D11_BUFFER_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_BUFFER_DESC : public D3D11_BUFFER_DESC {") -cpp_quote(" CD3D11_BUFFER_DESC() {}" ) -cpp_quote(" explicit CD3D11_BUFFER_DESC(const D3D11_BUFFER_DESC &o) : D3D11_BUFFER_DESC(o) {}") -cpp_quote(" explicit CD3D11_BUFFER_DESC(UINT byteWidth,UINT bindFlags,") -cpp_quote(" D3D11_USAGE usage = D3D11_USAGE_DEFAULT, UINT cpuaccessFlags = 0,") -cpp_quote(" UINT miscFlags = 0, UINT structureByteStride = 0 ) {") -cpp_quote(" ByteWidth = byteWidth;") -cpp_quote(" Usage = usage;") -cpp_quote(" BindFlags = bindFlags;") -cpp_quote(" CPUAccessFlags = cpuaccessFlags;") -cpp_quote(" MiscFlags = miscFlags;" ) -cpp_quote(" StructureByteStride = structureByteStride;") -cpp_quote(" }") -cpp_quote(" ~CD3D11_BUFFER_DESC() {}") -cpp_quote(" operator const D3D11_BUFFER_DESC&() const { return *this; }") -cpp_quote("};" ) -cpp_quote("#endif" ) - -typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC -{ - DXGI_FORMAT Format; - D3D11_DSV_DIMENSION ViewDimension; - UINT Flags; - - union - { - D3D11_TEX1D_DSV Texture1D; - D3D11_TEX1D_ARRAY_DSV Texture1DArray; - D3D11_TEX2D_DSV Texture2D; - D3D11_TEX2D_ARRAY_DSV Texture2DArray; - D3D11_TEX2DMS_DSV Texture2DMS; - D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray; - }; -} D3D11_DEPTH_STENCIL_VIEW_DESC; - -typedef struct D3D11_DEPTH_STENCILOP_DESC -{ - D3D11_STENCIL_OP StencilFailOp; - D3D11_STENCIL_OP StencilDepthFailOp; - D3D11_STENCIL_OP StencilPassOp; - D3D11_COMPARISON_FUNC StencilFunc; -} D3D11_DEPTH_STENCILOP_DESC; - -typedef struct D3D11_DEPTH_STENCIL_DESC -{ - BOOL DepthEnable; - D3D11_DEPTH_WRITE_MASK DepthWriteMask; - D3D11_COMPARISON_FUNC DepthFunc; - BOOL StencilEnable; - UINT8 StencilReadMask; - UINT8 StencilWriteMask; - D3D11_DEPTH_STENCILOP_DESC FrontFace; - D3D11_DEPTH_STENCILOP_DESC BackFace; -} D3D11_DEPTH_STENCIL_DESC; - -cpp_quote("#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )") -cpp_quote("struct CD3D11_DEPTH_STENCIL_DESC : public D3D11_DEPTH_STENCIL_DESC {") -cpp_quote(" CD3D11_DEPTH_STENCIL_DESC() {}") -cpp_quote(" explicit CD3D11_DEPTH_STENCIL_DESC(const D3D11_DEPTH_STENCIL_DESC &other) : D3D11_DEPTH_STENCIL_DESC(other) {}") -cpp_quote(" explicit CD3D11_DEPTH_STENCIL_DESC(CD3D11_DEFAULT) {") -cpp_quote(" const D3D11_DEPTH_STENCILOP_DESC default_op =") -cpp_quote(" {D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS};") -cpp_quote(" DepthEnable = TRUE;") -cpp_quote(" DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;") -cpp_quote(" DepthFunc = D3D11_COMPARISON_LESS;") -cpp_quote(" StencilEnable = FALSE;") -cpp_quote(" StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;") -cpp_quote(" StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;") -cpp_quote(" FrontFace = default_op;") -cpp_quote(" BackFace = default_op;") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_DEPTH_STENCIL_DESC(") -cpp_quote(" BOOL depth_enable,") -cpp_quote(" D3D11_DEPTH_WRITE_MASK depth_write_mask,") -cpp_quote(" D3D11_COMPARISON_FUNC depth_func,") -cpp_quote(" BOOL stencil_enable,") -cpp_quote(" UINT8 stencil_read_mask,") -cpp_quote(" UINT8 stencil_write_mask,") -cpp_quote(" D3D11_STENCIL_OP front_stencil_fail_op,") -cpp_quote(" D3D11_STENCIL_OP front_stencil_depth_fail_op,") -cpp_quote(" D3D11_STENCIL_OP front_stencil_pass_op,") -cpp_quote(" D3D11_COMPARISON_FUNC front_stencil_func,") -cpp_quote(" D3D11_STENCIL_OP back_stencil_fail_op,") -cpp_quote(" D3D11_STENCIL_OP back_stencil_depth_fail_op,") -cpp_quote(" D3D11_STENCIL_OP back_stencil_pass_op,") -cpp_quote(" D3D11_COMPARISON_FUNC back_stencil_func) {") -cpp_quote(" DepthEnable = depth_enable;") -cpp_quote(" DepthWriteMask = depth_write_mask;") -cpp_quote(" DepthFunc = depth_func;") -cpp_quote(" StencilEnable = stencil_enable;") -cpp_quote(" StencilReadMask = stencil_read_mask;") -cpp_quote(" StencilWriteMask = stencil_write_mask;") -cpp_quote(" FrontFace.StencilFailOp = front_stencil_fail_op;") -cpp_quote(" FrontFace.StencilDepthFailOp = front_stencil_depth_fail_op;") -cpp_quote(" FrontFace.StencilPassOp = front_stencil_pass_op;") -cpp_quote(" FrontFace.StencilFunc = front_stencil_func;") -cpp_quote(" BackFace.StencilFailOp = back_stencil_fail_op;") -cpp_quote(" BackFace.StencilDepthFailOp = back_stencil_depth_fail_op;") -cpp_quote(" BackFace.StencilPassOp = back_stencil_pass_op;") -cpp_quote(" BackFace.StencilFunc = back_stencil_func;") -cpp_quote(" }") -cpp_quote(" ~CD3D11_DEPTH_STENCIL_DESC() {}") -cpp_quote(" operator const D3D11_DEPTH_STENCIL_DESC&() const { return *this; }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D11_RENDER_TARGET_VIEW_DESC -{ - DXGI_FORMAT Format; - D3D11_RTV_DIMENSION ViewDimension; - - union - { - D3D11_BUFFER_RTV Buffer; - D3D11_TEX1D_RTV Texture1D; - D3D11_TEX1D_ARRAY_RTV Texture1DArray; - D3D11_TEX2D_RTV Texture2D; - D3D11_TEX2D_ARRAY_RTV Texture2DArray; - D3D11_TEX2DMS_RTV Texture2DMS; - D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray; - D3D11_TEX3D_RTV Texture3D; - }; -} D3D11_RENDER_TARGET_VIEW_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC {") -cpp_quote(" CD3D11_RENDER_TARGET_VIEW_DESC() {}") -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(D3D11_RTV_DIMENSION dim, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,") -cpp_quote(" UINT mip_slice = 0, UINT first_slice = 0, UINT array_size = -1) {") -cpp_quote(" Format = format;") -cpp_quote(" ViewDimension = dim;") -cpp_quote(" switch(dim) {") -cpp_quote(" case D3D11_RTV_DIMENSION_BUFFER:") -cpp_quote(" Buffer.FirstElement = mip_slice;") -cpp_quote(" Buffer.NumElements = first_slice;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE1D:") -cpp_quote(" Texture1D.MipSlice = mip_slice;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:") -cpp_quote(" Texture1DArray.MipSlice = mip_slice;") -cpp_quote(" Texture1DArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture1DArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE2D:") -cpp_quote(" Texture2D.MipSlice = mip_slice;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:") -cpp_quote(" Texture2DArray.MipSlice = mip_slice;") -cpp_quote(" Texture2DArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture2DArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:") -cpp_quote(" Texture2DMSArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture2DMSArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_RTV_DIMENSION_TEXTURE3D:") -cpp_quote(" Texture3D.MipSlice = mip_slice;") -cpp_quote(" Texture3D.FirstWSlice = first_slice;") -cpp_quote(" Texture3D.WSize = array_size;") -cpp_quote(" break;") -cpp_quote(" default:") -cpp_quote(" break;") -cpp_quote(" }") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(ID3D11Buffer*, DXGI_FORMAT format, UINT first_elem,") -cpp_quote(" UINT elem_cnt) {") -cpp_quote(" Format = format;") -cpp_quote(" ViewDimension = D3D11_RTV_DIMENSION_BUFFER;") -cpp_quote(" Buffer.FirstElement = first_elem;") -cpp_quote(" Buffer.NumElements = elem_cnt;") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(ID3D11Texture1D *texture, D3D11_RTV_DIMENSION dim,") -cpp_quote(" DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, UINT mip_slice = 0, UINT first_slice = 0,") -cpp_quote(" UINT array_size = -1);") /* FIXME: implement */ -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(ID3D11Texture2D *texture, D3D11_RTV_DIMENSION dim,") -cpp_quote(" DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, UINT mip_slice = 0, UINT first_slice = 0,") -cpp_quote(" UINT array_size = -1);") /* FIXME: implement */ -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(ID3D11Texture3D *texture, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,") -cpp_quote(" UINT mip_slice = 0, UINT first_w_slice = 0, UINT w_slice = -1 );") /* FIXME: implement */ -cpp_quote(" ~CD3D11_RENDER_TARGET_VIEW_DESC() {}") -cpp_quote(" explicit CD3D11_RENDER_TARGET_VIEW_DESC(const D3D11_RENDER_TARGET_VIEW_DESC &other)") -cpp_quote(" : D3D11_RENDER_TARGET_VIEW_DESC(other) {}") -cpp_quote(" operator const D3D11_RENDER_TARGET_VIEW_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - - -typedef struct D3D11_SAMPLER_DESC -{ - D3D11_FILTER Filter; - D3D11_TEXTURE_ADDRESS_MODE AddressU; - D3D11_TEXTURE_ADDRESS_MODE AddressV; - D3D11_TEXTURE_ADDRESS_MODE AddressW; - FLOAT MipLODBias; - UINT MaxAnisotropy; - D3D11_COMPARISON_FUNC ComparisonFunc; - FLOAT BorderColor[4]; - FLOAT MinLOD; - FLOAT MaxLOD; -} D3D11_SAMPLER_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC {") -cpp_quote(" CD3D11_SAMPLER_DESC() {}") -cpp_quote(" explicit CD3D11_SAMPLER_DESC(const D3D11_SAMPLER_DESC &o) : D3D11_SAMPLER_DESC(o) {}") -cpp_quote(" explicit CD3D11_SAMPLER_DESC(CD3D11_DEFAULT) {" ) -cpp_quote(" Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;") -cpp_quote(" AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;") -cpp_quote(" AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;") -cpp_quote(" AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;") -cpp_quote(" MipLODBias = 0;") -cpp_quote(" MaxAnisotropy = 1;") -cpp_quote(" ComparisonFunc = D3D11_COMPARISON_NEVER;") -cpp_quote(" BorderColor[0] = BorderColor[1] = BorderColor[2] = BorderColor[3] = 1.0f;") -cpp_quote(" MinLOD = -3.402823466e+38f;") -cpp_quote(" MaxLOD = 3.402823466e+38f;") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_SAMPLER_DESC(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressU,") -cpp_quote(" D3D11_TEXTURE_ADDRESS_MODE addressV, D3D11_TEXTURE_ADDRESS_MODE addressW,") -cpp_quote(" FLOAT mipLODBias, UINT maxAnisotropy, D3D11_COMPARISON_FUNC comparisonFunc,") -cpp_quote(" const FLOAT *borderColor, FLOAT minLOD, FLOAT maxLOD) {" ) -cpp_quote(" Filter = filter;") -cpp_quote(" AddressU = addressU;") -cpp_quote(" AddressV = addressV;") -cpp_quote(" AddressW = addressW;") -cpp_quote(" MipLODBias = mipLODBias;") -cpp_quote(" MaxAnisotropy = maxAnisotropy;") -cpp_quote(" ComparisonFunc = comparisonFunc;") -cpp_quote(" if(borderColor) {") -cpp_quote(" BorderColor[0] = borderColor[0];") -cpp_quote(" BorderColor[1] = borderColor[1];") -cpp_quote(" BorderColor[2] = borderColor[2];") -cpp_quote(" BorderColor[3] = borderColor[3];") -cpp_quote(" }else {") -cpp_quote(" BorderColor[0] = BorderColor[1] = BorderColor[2] = BorderColor[3] = 1.0f;") -cpp_quote(" }") -cpp_quote(" MinLOD = minLOD;") -cpp_quote(" MaxLOD = maxLOD;") -cpp_quote(" }") -cpp_quote(" ~CD3D11_SAMPLER_DESC() {}") -cpp_quote(" operator const D3D11_SAMPLER_DESC&() const { return *this; }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC -{ - DXGI_FORMAT Format; - D3D11_SRV_DIMENSION ViewDimension; - - union - { - D3D11_BUFFER_SRV Buffer; - D3D11_TEX1D_SRV Texture1D; - D3D11_TEX1D_ARRAY_SRV Texture1DArray; - D3D11_TEX2D_SRV Texture2D; - D3D11_TEX2D_ARRAY_SRV Texture2DArray; - D3D11_TEX2DMS_SRV Texture2DMS; - D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray; - D3D11_TEX3D_SRV Texture3D; - D3D11_TEXCUBE_SRV TextureCube; - D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray; - D3D11_BUFFEREX_SRV BufferEx; - }; -} D3D11_SHADER_RESOURCE_VIEW_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined( __cplusplus )") -cpp_quote("struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC {") -cpp_quote(" CD3D11_SHADER_RESOURCE_VIEW_DESC() {}") -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(D3D11_SRV_DIMENSION dim,") -cpp_quote(" DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, UINT most_detailed_mip = 0,") -cpp_quote(" UINT mip_levels = -1, UINT first_slice = 0, UINT array_size = -1, UINT flags = 0) {") -cpp_quote(" Format = format;") -cpp_quote(" ViewDimension = dim;") -cpp_quote(" switch(ViewDimension) {") -cpp_quote(" case D3D11_SRV_DIMENSION_BUFFER:") -cpp_quote(" Buffer.FirstElement = most_detailed_mip;") -cpp_quote(" Buffer.NumElements = mip_levels;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE1D:") -cpp_quote(" Texture1D.MostDetailedMip = most_detailed_mip;") -cpp_quote(" Texture1D.MipLevels = mip_levels;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:") -cpp_quote(" Texture1DArray.MostDetailedMip = most_detailed_mip;") -cpp_quote(" Texture1DArray.MipLevels = mip_levels;") -cpp_quote(" Texture1DArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture1DArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE2D:") -cpp_quote(" Texture2D.MostDetailedMip = most_detailed_mip;") -cpp_quote(" Texture2D.MipLevels = mip_levels;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:") -cpp_quote(" Texture2DArray.MostDetailedMip = most_detailed_mip;") -cpp_quote(" Texture2DArray.MipLevels = mip_levels;") -cpp_quote(" Texture2DArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture2DArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:") -cpp_quote(" Texture2DMSArray.FirstArraySlice = first_slice;") -cpp_quote(" Texture2DMSArray.ArraySize = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURE3D:") -cpp_quote(" Texture3D.MostDetailedMip = most_detailed_mip;") -cpp_quote(" Texture3D.MipLevels = mip_levels;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURECUBE:") -cpp_quote(" TextureCube.MostDetailedMip = most_detailed_mip;") -cpp_quote(" TextureCube.MipLevels = mip_levels;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:") -cpp_quote(" TextureCubeArray.MostDetailedMip = most_detailed_mip;") -cpp_quote(" TextureCubeArray.MipLevels = mip_levels;") -cpp_quote(" TextureCubeArray.First2DArrayFace = first_slice;") -cpp_quote(" TextureCubeArray.NumCubes = array_size;") -cpp_quote(" break;") -cpp_quote(" case D3D11_SRV_DIMENSION_BUFFEREX:") -cpp_quote(" BufferEx.FirstElement = most_detailed_mip;") -cpp_quote(" BufferEx.NumElements = mip_levels;") -cpp_quote(" BufferEx.Flags = flags;") -cpp_quote(" break;") -cpp_quote(" default:") -cpp_quote(" break;") -cpp_quote(" }") -cpp_quote(" }") -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(ID3D11Buffer*, DXGI_FORMAT format, UINT first_elem,") -cpp_quote(" UINT elem_cnt, UINT flags = 0);") /* FIXME: implement */ -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(ID3D11Texture1D *texture, D3D11_SRV_DIMENSION dim,") -cpp_quote(" DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, UINT most_detailed_mip = 0, UINT mip_levels = -1,") -cpp_quote(" UINT first_slice = 0, UINT array_size = -1 );") /* FIXME: implement */ -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(ID3D11Texture2D *texture, D3D11_SRV_DIMENSION dim,") -cpp_quote(" DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, UINT most_detailed_mip = 0, UINT mip_levels = -1,") -cpp_quote(" UINT first_slice = 0, UINT array_size = -1 );") /* FIXME: implement */ -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(ID3D11Texture3D *texture, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,") -cpp_quote(" UINT most_detailed_mip = 0, UINT mip_levels = -1 );") -cpp_quote(" ~CD3D11_SHADER_RESOURCE_VIEW_DESC() {}") -cpp_quote(" explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(const D3D11_SHADER_RESOURCE_VIEW_DESC &other)") -cpp_quote(" : D3D11_SHADER_RESOURCE_VIEW_DESC(other) {}") -cpp_quote(" operator const D3D11_SHADER_RESOURCE_VIEW_DESC&() const {") -cpp_quote(" return *this;") -cpp_quote(" }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D11_TEXTURE1D_DESC -{ - UINT Width; - UINT MipLevels; - UINT ArraySize; - DXGI_FORMAT Format; - D3D11_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D11_TEXTURE1D_DESC; - -typedef struct D3D11_TEXTURE2D_DESC -{ - UINT Width; - UINT Height; - UINT MipLevels; - UINT ArraySize; - DXGI_FORMAT Format; - DXGI_SAMPLE_DESC SampleDesc; - D3D11_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D11_TEXTURE2D_DESC; - -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_TEXTURE2D_DESC : public D3D11_TEXTURE2D_DESC {") -cpp_quote(" CD3D11_TEXTURE2D_DESC() {}") -cpp_quote(" explicit CD3D11_TEXTURE2D_DESC(const D3D11_TEXTURE2D_DESC &o) : D3D11_TEXTURE2D_DESC(o) {}") -cpp_quote(" explicit CD3D11_TEXTURE2D_DESC(DXGI_FORMAT format, UINT width, UINT height, UINT arraySize = 1,") -cpp_quote(" UINT mipLevels = 0, UINT bindFlags = D3D11_BIND_SHADER_RESOURCE,") -cpp_quote(" D3D11_USAGE usage = D3D11_USAGE_DEFAULT, UINT cpuaccessFlags = 0, UINT sampleCount = 1," ) -cpp_quote(" UINT sampleQuality = 0, UINT miscFlags = 0) {") -cpp_quote(" Width = width;") -cpp_quote(" Height = height;") -cpp_quote(" MipLevels = mipLevels;") -cpp_quote(" ArraySize = arraySize;") -cpp_quote(" Format = format;") -cpp_quote(" SampleDesc.Count = sampleCount;") -cpp_quote(" SampleDesc.Quality = sampleQuality;") -cpp_quote(" Usage = usage;") -cpp_quote(" BindFlags = bindFlags;") -cpp_quote(" CPUAccessFlags = cpuaccessFlags;") -cpp_quote(" MiscFlags = miscFlags;") -cpp_quote(" }" ) -cpp_quote(" ~CD3D11_TEXTURE2D_DESC() {}") -cpp_quote(" operator const D3D11_TEXTURE2D_DESC&() const { return *this; }") -cpp_quote("};") -cpp_quote("#endif") - -typedef struct D3D11_TEXTURE3D_DESC -{ - UINT Width; - UINT Height; - UINT Depth; - UINT MipLevels; - DXGI_FORMAT Format; - D3D11_USAGE Usage; - UINT BindFlags; - UINT CPUAccessFlags; - UINT MiscFlags; -} D3D11_TEXTURE3D_DESC; - -typedef struct D3D11_VIDEO_DECODER_DESC -{ - GUID Guid; - UINT SampleWidth; - UINT SampleHeight; - DXGI_FORMAT OutputFormat; -} D3D11_VIDEO_DECODER_DESC; - -typedef struct D3D11_VIDEO_DECODER_CONFIG -{ - GUID guidConfigBitstreamEncryption; - GUID guidConfigMBcontrolEncryption; - GUID guidConfigResidDiffEncryption; - UINT ConfigBitstreamRaw; - UINT ConfigMBcontrolRasterOrder; - UINT ConfigResidDiffHost; - UINT ConfigSpatialResid8; - UINT ConfigResid8Subtraction; - UINT ConfigSpatialHost8or9Clipping; - UINT ConfigSpatialResidInterleaved; - UINT ConfigIntraResidUnsigned; - UINT ConfigResidDiffAccelerator; - UINT ConfigHostInverseScan; - UINT ConfigSpecificIDCT; - UINT Config4GroupedCoefs; - USHORT ConfigMinRenderTargetBuffCount; - USHORT ConfigDecoderSpecific; -} D3D11_VIDEO_DECODER_CONFIG; - -typedef enum D3D11_VIDEO_FRAME_FORMAT -{ - D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0, - D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1, - D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2 -} D3D11_VIDEO_FRAME_FORMAT; - -typedef enum D3D11_VIDEO_USAGE -{ - D3D11_VIDEO_USAGE_PLAYBACK_NORMAL = 0, - D3D11_VIDEO_USAGE_OPTIMAL_SPEED = 1, - D3D11_VIDEO_USAGE_OPTIMAL_QUALITY = 2 -} D3D11_VIDEO_USAGE; - -typedef struct D3D11_VIDEO_PROCESSOR_CONTENT_DESC -{ - D3D11_VIDEO_FRAME_FORMAT InputFrameFormat; - DXGI_RATIONAL InputFrameRate; - UINT InputWidth; - UINT InputHeight; - DXGI_RATIONAL OutputFrameRate; - UINT OutputWidth; - UINT OutputHeight; - D3D11_VIDEO_USAGE Usage; -} D3D11_VIDEO_PROCESSOR_CONTENT_DESC; - -typedef struct D3D11_VIDEO_PROCESSOR_CAPS -{ - UINT DeviceCaps; - UINT FeatureCaps; - UINT FilterCaps; - UINT InputFormatCaps; - UINT AutoStreamCaps; - UINT StereoCaps; - UINT RateConversionCapsCount; - UINT MaxInputStreams; - UINT MaxStreamStates; -} D3D11_VIDEO_PROCESSOR_CAPS; - -typedef struct D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS -{ - UINT PastFrames; - UINT FutureFrames; - UINT ProcessorCaps; - UINT ITelecineCaps; - UINT CustomRateCount; -} D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS; - -typedef struct D3D11_VIDEO_PROCESSOR_CUSTOM_RATE -{ - DXGI_RATIONAL CustomRate; - UINT OutputFrames; - BOOL InputInterlaced; - UINT InputFramesOrFields; -} D3D11_VIDEO_PROCESSOR_CUSTOM_RATE; - -typedef enum D3D11_VIDEO_PROCESSOR_FILTER -{ - D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS = 0, - D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST = 1, - D3D11_VIDEO_PROCESSOR_FILTER_HUE = 2, - D3D11_VIDEO_PROCESSOR_FILTER_SATURATION = 3, - D3D11_VIDEO_PROCESSOR_FILTER_NOISE_REDUCTION = 4, - D3D11_VIDEO_PROCESSOR_FILTER_EDGE_ENHANCEMENT = 5, - D3D11_VIDEO_PROCESSOR_FILTER_ANAMORPHIC_SCALING = 6, - D3D11_VIDEO_PROCESSOR_FILTER_STEREO_ADJUSTMENT = 7 -} D3D11_VIDEO_PROCESSOR_FILTER; - -typedef struct D3D11_VIDEO_PROCESSOR_FILTER_RANGE -{ - int Minimum; - int Maximum; - int Default; - float Multiplier; -} D3D11_VIDEO_PROCESSOR_FILTER_RANGE; - -typedef enum D3D11_AUTHENTICATED_CHANNEL_TYPE -{ - D3D11_AUTHENTICATED_CHANNEL_D3D11 = 1, - D3D11_AUTHENTICATED_CHANNEL_DRIVER_SOFTWARE = 2, - D3D11_AUTHENTICATED_CHANNEL_DRIVER_HARDWARE = 3 -} D3D11_AUTHENTICATED_CHANNEL_TYPE; - -typedef enum D3D11_VDOV_DIMENSION -{ - D3D11_VDOV_DIMENSION_UNKNOWN = 0, - D3D11_VDOV_DIMENSION_TEXTURE2D = 1 -} D3D11_VDOV_DIMENSION; - -typedef struct D3D11_TEX2D_VDOV -{ - UINT ArraySlice; -} D3D11_TEX2D_VDOV; - -typedef struct D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC -{ - GUID DecodeProfile; - D3D11_VDOV_DIMENSION ViewDimension; - union { - D3D11_TEX2D_VDOV Texture2D; - }; -} D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC; - -typedef enum D3D11_VPIV_DIMENSION -{ - D3D11_VPIV_DIMENSION_UNKNOWN = 0, - D3D11_VPIV_DIMENSION_TEXTURE2D = 1 -} D3D11_VPIV_DIMENSION; - -typedef struct D3D11_TEX2D_VPIV -{ - UINT MipSlice; - UINT ArraySlice; -} D3D11_TEX2D_VPIV; - -typedef struct D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC -{ - UINT FourCC; - D3D11_VPIV_DIMENSION ViewDimension; - union { - D3D11_TEX2D_VPIV Texture2D; - }; -} D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC; - -typedef enum D3D11_VPOV_DIMENSION -{ - D3D11_VPOV_DIMENSION_UNKNOWN = 0, - D3D11_VPOV_DIMENSION_TEXTURE2D = 1, - D3D11_VPOV_DIMENSION_TEXTURE2DARRAY = 2 -} D3D11_VPOV_DIMENSION; - -typedef struct D3D11_TEX2D_VPOV -{ - UINT MipSlice; -} D3D11_TEX2D_VPOV; - -typedef struct D3D11_TEX2D_ARRAY_VPOV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} D3D11_TEX2D_ARRAY_VPOV; - -typedef struct D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC -{ - D3D11_VPOV_DIMENSION ViewDimension; - union { - D3D11_TEX2D_VPOV Texture2D; - D3D11_TEX2D_ARRAY_VPOV Texture2DArray; - }; -} D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC; - -typedef struct D3D11_VIDEO_CONTENT_PROTECTION_CAPS -{ - UINT Caps; - UINT KeyExchangeTypeCount; - UINT BlockAlignmentSize; - ULONGLONG ProtectedMemorySize; -} D3D11_VIDEO_CONTENT_PROTECTION_CAPS; - -typedef struct D3D11_ENCRYPTED_BLOCK_INFO -{ - UINT NumEncryptedBytesAtBeginning; - UINT NumBytesInSkipPattern; - UINT NumBytesInEncryptPattern; -} D3D11_ENCRYPTED_BLOCK_INFO; - -typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC -{ - D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType; - UINT BufferIndex; - UINT DataOffset; - UINT DataSize; - UINT FirstMBaddress; - UINT NumMBsInBuffer; - UINT Width; - UINT Height; - UINT Stride; - UINT ReservedBits; - void *pIV; - UINT IVSize; - BOOL PartialEncryption; - D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo; -} D3D11_VIDEO_DECODER_BUFFER_DESC; - -typedef struct D3D11_VIDEO_DECODER_EXTENSION -{ - UINT Function; - void *pPrivateInputData; - UINT PrivateInputDataSize; - void *pPrivateOutputData; - UINT PrivateOutputDataSize; - UINT ResourceCount; - ID3D11Resource **ppResourceList; -} D3D11_VIDEO_DECODER_EXTENSION; - -typedef struct D3D11_VIDEO_COLOR_YCbCrA -{ - float Y; - float Cb; - float Cr; - float A; -} D3D11_VIDEO_COLOR_YCbCrA; - -typedef struct D3D11_VIDEO_COLOR_RGBA -{ - float R; - float G; - float B; - float A; -} D3D11_VIDEO_COLOR_RGBA; - -typedef struct D3D11_VIDEO_COLOR -{ - union - { - D3D11_VIDEO_COLOR_YCbCrA YCbCr; - D3D11_VIDEO_COLOR_RGBA RGBA; - }; -} D3D11_VIDEO_COLOR; - -typedef struct D3D11_VIDEO_PROCESSOR_COLOR_SPACE -{ - UINT Usage : 1; - UINT RGB_Range : 1; - UINT YCbCr_Matrix : 1; - UINT YCbCr_xvYCC : 1; - UINT Nominal_Range : 2; - UINT Reserved : 26; -} D3D11_VIDEO_PROCESSOR_COLOR_SPACE; - -typedef struct D3D11_VIDEO_PROCESSOR_STREAM -{ - BOOL Enable; - UINT OutputIndex; - UINT InputFrameOrField; - UINT PastFrames; - UINT FutureFrames; - ID3D11VideoProcessorInputView **ppPastSurfaces; - ID3D11VideoProcessorInputView *pInputSurface; - ID3D11VideoProcessorInputView **ppFutureSurfaces; - ID3D11VideoProcessorInputView **ppPastSurfacesRight; - ID3D11VideoProcessorInputView *pInputSurfaceRight; - ID3D11VideoProcessorInputView **ppFutureSurfacesRight; -} D3D11_VIDEO_PROCESSOR_STREAM; - -typedef struct D3D11_OMAC -{ - BYTE Omac[D3D11_OMAC_SIZE]; -} D3D11_OMAC; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_OUTPUT -{ - D3D11_OMAC omac; - GUID ConfigureType; - HANDLE hChannel; - UINT SequenceNumber; - HRESULT ReturnCode; -} D3D11_AUTHENTICATED_CONFIGURE_OUTPUT; - -typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT -{ - UINT64 Frequency; - BOOL Disjoint; -} D3D11_QUERY_DATA_TIMESTAMP_DISJOINT; - -typedef struct D3D11_QUERY_DATA_PIPELINE_STATISTICS -{ - UINT64 IAVertices; - UINT64 IAPrimitives; - UINT64 VSInvocations; - UINT64 GSInvocations; - UINT64 GSPrimitives; - UINT64 CInvocations; - UINT64 CPrimitives; - UINT64 PSInvocations; - UINT64 HSInvocations; - UINT64 DSInvocations; - UINT64 CSInvocations; -} D3D11_QUERY_DATA_PIPELINE_STATISTICS; - -typedef struct D3D11_DRAW_INSTANCED_INDIRECT_ARGS -{ - UINT VertexCountPerInstance; - UINT InstanceCount; - UINT StartVertexLocation; - UINT StartInstanceLocation; -} D3D11_DRAW_INSTANCED_INDIRECT_ARGS; - -typedef struct D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS -{ - UINT IndexCountPerInstance; - UINT InstanceCount; - UINT StartIndexLocation; - INT BaseVertexLocation; - UINT StartInstanceLocation; -} D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_INPUT -{ - D3D11_OMAC omac; - GUID ConfigureType; - HANDLE hChannel; - UINT SequenceNumber; -} D3D11_AUTHENTICATED_CONFIGURE_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_INPUT -{ - GUID QueryType; - HANDLE hChannel; - UINT SequenceNumber; -} D3D11_AUTHENTICATED_QUERY_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT -{ - D3D11_OMAC omac; - GUID QueryType; - HANDLE hChannel; - UINT SequenceNumber; - HRESULT ReturnCode; -} D3D11_AUTHENTICATED_QUERY_OUTPUT; - -typedef union D3D11_AUTHENTICATED_PROTECTION_FLAGS -{ - struct - { - UINT ProtectionEnabled : 1; - UINT OverlayOrFullscreenRequired : 1; - UINT Reserved : 30; - } Flags; - UINT Value; -} D3D11_AUTHENTICATED_PROTECTION_FLAGS; - -typedef struct D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - D3D11_AUTHENTICATED_PROTECTION_FLAGS ProtectionFlags; -} D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType; -} D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - HANDLE DeviceHandle; -} D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT -{ - D3D11_AUTHENTICATED_QUERY_INPUT Input; - HANDLE DecoderHandle; -} D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - HANDLE DecoderHandle; - HANDLE CryptoSessionHandle; - HANDLE DeviceHandle; -} D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - UINT RestrictedSharedResourceProcessCount; -} D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT -{ - D3D11_AUTHENTICATED_QUERY_INPUT Input; - UINT ProcessIndex; -} D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - UINT ProcessIndex; - D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessIdentifier; - HANDLE ProcessHandle; -} D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - UINT UnrestrictedProtectedSharedResourceCount; -} D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT -{ - D3D11_AUTHENTICATED_QUERY_INPUT Input; - HANDLE DeviceHandle; - HANDLE CryptoSessionHandle; -} D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - HANDLE DeviceHandle; - HANDLE CryptoSessionHandle; - UINT OutputIDCount; -} D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT -{ - D3D11_AUTHENTICATED_QUERY_INPUT Input; - HANDLE DeviceHandle; - HANDLE CryptoSessionHandle; - UINT OutputIDIndex; -} D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - HANDLE DeviceHandle; - HANDLE CryptoSessionHandle; - UINT OutputIDIndex; - UINT64 OutputID; -} D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_ACESSIBILITY_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - D3D11_BUS_TYPE BusType; - BOOL AccessibleInContiguousBlocks; - BOOL AccessibleInNonContiguousBlocks; -} D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - UINT EncryptionGuidCount; -} D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT -{ - D3D11_AUTHENTICATED_QUERY_INPUT Input; - UINT EncryptionGuidIndex; -} D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - UINT EncryptionGuidIndex; - GUID EncryptionGuid; -} D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT -{ - D3D11_AUTHENTICATED_QUERY_OUTPUT Output; - GUID EncryptionGuid; -} D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT -{ - D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters; - UINT StartSequenceQuery; - UINT StartSequenceConfigure; -} D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT -{ - D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters; - D3D11_AUTHENTICATED_PROTECTION_FLAGS Protections; -} D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT -{ - D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters; - HANDLE DecoderHandle; - HANDLE CryptoSessionHandle; - HANDLE DeviceHandle; -} D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT -{ - D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters; - D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessType; - HANDLE ProcessHandle; - BOOL AllowAccess; -} D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT; - -typedef struct D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT -{ - D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters; - GUID EncryptionGuid; -} D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT; - -[ - object, - local, - uuid(1841e5c8-16b0-489b-bcc8-44cfb0d5deae) -] -interface ID3D11DeviceChild : IUnknown -{ - void GetDevice( - [out] ID3D11Device **ppDevice); - HRESULT GetPrivateData( - [in] REFGUID guid, - [in, out] UINT *pDataSize, - [out] void *pData); - HRESULT SetPrivateData( - [in] REFGUID guid, - [in] UINT DataSize, - [in] const void *pData); - HRESULT SetPrivateDataInterface( - [in] REFGUID guid, - [in] const IUnknown *pData); -} - -[ - object, - local, - uuid(4b35d0cd-1e15-4258-9c98-1b1333f6dd3b) -] -interface ID3D11Asynchronous : ID3D11DeviceChild -{ - UINT GetDataSize(); -} - -[ - object, - local, - uuid(d6c00747-87b7-425e-b84d-44d108560afd) -] -interface ID3D11Query : ID3D11Asynchronous -{ - void GetDesc( - [out] D3D11_QUERY_DESC *pDesc); -} - -[ - object, - local, - uuid(dc8e63f3-d12b-4952-b47b-5e45026a862d) -] -interface ID3D11Resource : ID3D11DeviceChild -{ - void GetType( - [out] D3D11_RESOURCE_DIMENSION *pResourceDimension); - void SetEvictionPriority( - [in] UINT EvictionPriority); - UINT GetEvictionPriority(); -} - -[ - object, - local, - uuid(839d1216-bb2e-412b-b7f4-a9dbebe08ed1) -] -interface ID3D11View : ID3D11DeviceChild -{ - void GetResource( - [out] ID3D11Resource **ppResource); -} - -[ - object, - local, - uuid(75b68faa-347d-4159-8f45-a0640f01cd9a) -] -interface ID3D11BlendState : ID3D11DeviceChild -{ - void GetDesc( - [out] D3D11_BLEND_DESC *pDesc); -} - -[ - object, - local, - uuid(48570b85-d1ee-4fcd-a250-eb350722b037) -] -interface ID3D11Buffer : ID3D11Resource -{ - void GetDesc( - [out] D3D11_BUFFER_DESC *pDesc); -} - -[ - object, - local, - uuid(a6cd7faa-b0b7-4a2f-9436-8662a65797cb) -] -interface ID3D11ClassInstance : ID3D11DeviceChild -{ - void GetClassLinkage( - [out] ID3D11ClassLinkage **ppLinkage); - void GetDesc( - [out] D3D11_CLASS_INSTANCE_DESC *pDesc); - void GetInstanceName( - [out] LPSTR pInstanceName, - [in, out] SIZE_T *pBufferLength); - void GetTypeName( - [out] LPSTR pTypeName, - [in, out] SIZE_T *pBufferLength); -} - -[ - object, - local, - uuid(ddf57cba-9543-46e4-a12b-f207a0fe7fed) -] -interface ID3D11ClassLinkage : ID3D11DeviceChild -{ - HRESULT GetClassInstance( - [in] LPCSTR pClassInstanceName, - [in] UINT InstanceIndex, - [out] ID3D11ClassInstance **ppInstance); - HRESULT CreateClassInstance( - [in] LPCSTR pClassTypeName, - [in] UINT ConstantBufferOffset, - [in] UINT ConstantVectorOffset, - [in] UINT TextureOffset, - [in] UINT SamplerOffset, - [out] ID3D11ClassInstance **ppInstance); -} - -[ - object, - local, - uuid(a24bc4d1-769e-43f7-8013-98ff566c18e2) -] -interface ID3D11CommandList : ID3D11DeviceChild -{ - UINT GetContextFlags(); -} - -[ - object, - local, - uuid(4f5b196e-c2bd-495e-bd01-1fded38e4969) -] -interface ID3D11ComputeShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(6e8c49fb-a371-4770-b440-29086022b741) -] -interface ID3D11Counter : ID3D11Asynchronous -{ - void GetDesc( - [out] D3D11_COUNTER_DESC *pDesc); -} - -[ - object, - local, - uuid(03823efb-8d8f-4e1c-9aa2-f64bb2cbfdf1) -] -interface ID3D11DepthStencilState : ID3D11DeviceChild -{ - void GetDesc( - [out] D3D11_DEPTH_STENCIL_DESC *pDesc); -} - -[ - object, - local, - uuid(9fdac92a-1876-48c3-afad-25b94f84a9b6) -] -interface ID3D11DepthStencilView : ID3D11View -{ - void GetDesc( - [out] D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc); -} - -[ - object, - local, - uuid(f582c508-0f36-490c-9977-31eece268cfa) -] -interface ID3D11DomainShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(38325b96-effb-4022-ba02-2e795b70275c) -] -interface ID3D11GeometryShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(8e5c6061-628a-4c8e-8264-bbe45cb3d5dd) -] -interface ID3D11HullShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(e4819ddc-4cf0-4025-bd26-5de82a3e07b7) -] -interface ID3D11InputLayout : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(ea82e40d-51dc-4f33-93d4-db7c9125ae8c) -] -interface ID3D11PixelShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(9eb576dd-9f77-4d86-81aa-8bab5fe490e2) -] -interface ID3D11Predicate : ID3D11Query -{ -} - -[ - object, - local, - uuid(9bb4ab81-ab1a-4d8f-b506-fc04200b6ee7) -] -interface ID3D11RasterizerState : ID3D11DeviceChild -{ - void GetDesc( - [out] D3D11_RASTERIZER_DESC *pDesc); -} - -[ - object, - local, - uuid(dfdba067-0b8d-4865-875b-d7b4516cc164) -] -interface ID3D11RenderTargetView : ID3D11View -{ - void GetDesc( - [out] D3D11_RENDER_TARGET_VIEW_DESC *pDesc); -} - -[ - object, - local, - uuid(da6fea51-564c-4487-9810-f0d0f9b4e3a5) -] -interface ID3D11SamplerState : ID3D11DeviceChild -{ - void GetDesc( - [out] D3D11_SAMPLER_DESC *pDesc); -} - -[ - object, - local, - uuid(b0e06fe0-8192-4e1a-b1ca-36d7414710b2) -] -interface ID3D11ShaderResourceView : ID3D11View -{ - void GetDesc( - [out] D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc); -} - -[ - object, - local, - uuid(f8fb5c27-c6b3-4f75-a4c8-439af2ef564c), -] -interface ID3D11Texture1D : ID3D11Resource -{ - void GetDesc( - [out] D3D11_TEXTURE1D_DESC *pDesc); -} - -[ - object, - local, - uuid(6f15aaf2-d208-4e89-9ab4-489535d34f9c) -] -interface ID3D11Texture2D : ID3D11Resource -{ - void GetDesc( - [out] D3D11_TEXTURE2D_DESC *pDesc); -} - -[ - object, - local, - uuid(037e866e-f56d-4357-a8af-9dabbe6e250e) -] -interface ID3D11Texture3D : ID3D11Resource -{ - void GetDesc( - [out] D3D11_TEXTURE3D_DESC *pDesc); -} - -[ - object, - local, - uuid(28acf509-7f5c-48f6-8611-f316010a6380) -] -interface ID3D11UnorderedAccessView : ID3D11View -{ - void GetDesc( - [out] D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc); -} - -[ - object, - local, - uuid(3b301d64-d678-4289-8897-22f8928b72f3) -] -interface ID3D11VertexShader : ID3D11DeviceChild -{ -} - -[ - object, - local, - uuid(c0bfa96c-e089-44fb-8eaf-26f8796190da) -] -interface ID3D11DeviceContext : ID3D11DeviceChild -{ - void VSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void PSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void PSSetShader( - [in] ID3D11PixelShader *pPixelShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void PSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void VSSetShader( - [in] ID3D11VertexShader *pVertexShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void DrawIndexed( - [in] UINT IndexCount, - [in] UINT StartIndexLocation, - [in] INT BaseVertexLocation); - void Draw( - [in] UINT VertexCount, - [in] UINT StartVertexLocation); - HRESULT Map( - [in] ID3D11Resource *pResource, - [in] UINT Subresource, - [in] D3D11_MAP MapType, - [in] UINT MapFlags, - [out] D3D11_MAPPED_SUBRESOURCE *pMappedResource); - void Unmap( - [in] ID3D11Resource *pResource, - [in] UINT Subresource); - void PSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void IASetInputLayout( - [in] ID3D11InputLayout *pInputLayout); - void IASetVertexBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppVertexBuffers, - [in] const UINT *pStrides, - [in] const UINT *pOffsets); - void IASetIndexBuffer( - [in] ID3D11Buffer *pIndexBuffer, - [in] DXGI_FORMAT Format, - [in] UINT Offset); - void DrawIndexedInstanced( - [in] UINT IndexCountPerInstance, - [in] UINT InstanceCount, - [in] UINT StartIndexLocation, - [in] INT BaseVertexLocation, - [in] UINT StartInstanceLocation); - void DrawInstanced( - [in] UINT VertexCountPerInstance, - [in] UINT InstanceCount, - [in] UINT StartVertexLocation, - [in] UINT StartInstanceLocation); - void GSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void GSSetShader( - [in] ID3D11GeometryShader *pShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void IASetPrimitiveTopology( - [in] D3D11_PRIMITIVE_TOPOLOGY Topology); - void VSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void VSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void Begin( - [in] ID3D11Asynchronous *pAsync); - void End( - [in] ID3D11Asynchronous *pAsync); - HRESULT GetData( - [in] ID3D11Asynchronous *pAsync, - [in] void *pData, - [in] UINT DataSize, - [in] UINT GetDataFlags); - void SetPredication( - [in] ID3D11Predicate *pPredicate, - [in] BOOL PredicateValue); - void GSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void GSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void OMSetRenderTargets( - [in] UINT NumViews, - [in] ID3D11RenderTargetView *const *ppRenderTargetViews, - [in] ID3D11DepthStencilView *pDepthStencilView); - void OMSetRenderTargetsAndUnorderedAccessViews( - [in] UINT NumRTVs, - [in] ID3D11RenderTargetView *const *ppRenderTargetViews, - [in] ID3D11DepthStencilView *pDepthStencilView, - [in] UINT UAVStartSlot, - [in] UINT NumUAVs, - [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, - [in] const UINT *pUAVInitialCounts); - void OMSetBlendState( - [in] ID3D11BlendState *pBlendState, - [in] const FLOAT BlendFactor[4], - [in] UINT SampleMask); - void OMSetDepthStencilState( - [in] ID3D11DepthStencilState *pDepthStencilState, - [in] UINT StencilRef); - void SOSetTargets( - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppSOTargets, - [in] const UINT *pOffsets); - void DrawAuto(); - void DrawIndexedInstancedIndirect( - [in] ID3D11Buffer *pBufferForArgs, - [in] UINT AlignedByteOffsetForArgs); - void DrawInstancedIndirect( - [in] ID3D11Buffer *pBufferForArgs, - [in] UINT AlignedByteOffsetForArgs); - void Dispatch( - [in] UINT ThreadGroupCountX, - [in] UINT ThreadGroupCountY, - [in] UINT ThreadGroupCountZ); - void DispatchIndirect( - [in] ID3D11Buffer *pBufferForArgs, - [in] UINT AlignedByteOffsetForArgs); - void RSSetState( - [in] ID3D11RasterizerState *pRasterizerState); - void RSSetViewports( - [in] UINT NumViewports, - [in] const D3D11_VIEWPORT *pViewports); - void RSSetScissorRects( - [in] UINT NumRects, - [in] const D3D11_RECT *pRects); - void CopySubresourceRegion( - [in] ID3D11Resource *pDstResource, - [in] UINT DstSubresource, - [in] UINT DstX, - [in] UINT DstY, - [in] UINT DstZ, - [in] ID3D11Resource *pSrcResource, - [in] UINT SrcSubresource, - [in] const D3D11_BOX *pSrcBox); - void CopyResource( - [in] ID3D11Resource *pDstResource, - [in] ID3D11Resource *pSrcResource); - void UpdateSubresource( - [in] ID3D11Resource *pDstResource, - [in] UINT DstSubresource, - [in] const D3D11_BOX *pDstBox, - [in] const void *pSrcData, - [in] UINT SrcRowPitch, - [in] UINT SrcDepthPitch); - void CopyStructureCount( - [in] ID3D11Buffer *pDstBuffer, - [in] UINT DstAlignedByteOffset, - [in] ID3D11UnorderedAccessView *pSrcView); - void ClearRenderTargetView( - [in] ID3D11RenderTargetView *pRenderTargetView, - [in] const FLOAT ColorRGBA[4]); - void ClearUnorderedAccessViewUint( - [in] ID3D11UnorderedAccessView *pUnorderedAccessView, - [in] const UINT Values[4]); - void ClearUnorderedAccessViewFloat( - [in] ID3D11UnorderedAccessView *pUnorderedAccessView, - [in] const FLOAT Values[4]); - void ClearDepthStencilView( - [in] ID3D11DepthStencilView *pDepthStencilView, - [in] UINT ClearFlags, - [in] FLOAT Depth, - [in] UINT8 Stencil); - void GenerateMips( - [in] ID3D11ShaderResourceView *pShaderResourceView); - void SetResourceMinLOD( - [in] ID3D11Resource *pResource, FLOAT MinLOD); - FLOAT GetResourceMinLOD( - [in] ID3D11Resource *pResource); - void ResolveSubresource( - [in] ID3D11Resource *pDstResource, - [in] UINT DstSubresource, - [in] ID3D11Resource *pSrcResource, - [in] UINT SrcSubresource, - [in] DXGI_FORMAT Format); - void ExecuteCommandList( - [in] ID3D11CommandList *pCommandList, - BOOL RestoreContextState); - void HSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void HSSetShader( - [in] ID3D11HullShader *pHullShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void HSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void HSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void DSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void DSSetShader( - [in] ID3D11DomainShader *pDomainShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void DSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void DSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void CSSetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [in] ID3D11ShaderResourceView *const *ppShaderResourceViews); - void CSSetUnorderedAccessViews( - [in] UINT StartSlot, - [in] UINT NumUAVs, - [in] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, - [in] const UINT *pUAVInitialCounts); - void CSSetShader( - [in] ID3D11ComputeShader *pComputeShader, - [in] ID3D11ClassInstance *const *ppClassInstances, - UINT NumClassInstances); - void CSSetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [in] ID3D11SamplerState *const *ppSamplers); - void CSSetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [in] ID3D11Buffer *const *ppConstantBuffers); - void VSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void PSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void PSGetShader( - [out] ID3D11PixelShader **ppPixelShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void PSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void VSGetShader( - [out] ID3D11VertexShader **ppVertexShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void PSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void IAGetInputLayout( - [out] ID3D11InputLayout **ppInputLayout); - void IAGetVertexBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppVertexBuffers, - [out] UINT *pStrides, - [out] UINT *pOffsets); - void IAGetIndexBuffer( - [out] ID3D11Buffer **pIndexBuffer, - [out] DXGI_FORMAT* Format, - [out] UINT* Offset); - void GSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void GSGetShader( - [out] ID3D11GeometryShader **ppGeometryShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void IAGetPrimitiveTopology( - [out] D3D11_PRIMITIVE_TOPOLOGY *pTopology); - void VSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void VSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void GetPredication( - [out] ID3D11Predicate **ppPredicate, - [out] BOOL *pPredicateValue); - void GSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void GSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void OMGetRenderTargets( - [in] UINT NumViews, - [out] ID3D11RenderTargetView **ppRenderTargetViews, - [out] ID3D11DepthStencilView **ppDepthStencilView); - void OMGetRenderTargetsAndUnorderedAccessViews( - [in] UINT NumRTVs, - [out] ID3D11RenderTargetView **ppRenderTargetViews, - [out] ID3D11DepthStencilView **ppDepthStencilView, - [in] UINT UAVStartSlot, - [in] UINT NumUAVs, - [out] ID3D11UnorderedAccessView **ppUnorderedAccessViews); - void OMGetBlendState( - [out] ID3D11BlendState **ppBlendState, - [out] FLOAT BlendFactor[4], - [out] UINT *pSampleMask); - void OMGetDepthStencilState( - [out] ID3D11DepthStencilState **ppDepthStencilState, - [out] UINT *pStencilRef); - void SOGetTargets( - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppSOTargets); - void RSGetState( - [out] ID3D11RasterizerState **ppRasterizerState); - void RSGetViewports( - [in, out] UINT *pNumViewports, - [out] D3D11_VIEWPORT *pViewports); - void RSGetScissorRects( - [in, out] UINT *pNumRects, - [out] D3D11_RECT *pRects); - void HSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void HSGetShader( - [out] ID3D11HullShader **ppHullShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void HSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void HSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void DSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void DSGetShader( - [out] ID3D11DomainShader **ppDomainShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void DSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void DSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void CSGetShaderResources( - [in] UINT StartSlot, - [in] UINT NumViews, - [out] ID3D11ShaderResourceView **ppShaderResourceViews); - void CSGetUnorderedAccessViews( - [in] UINT StartSlot, - [in] UINT NumUAVs, - [out] ID3D11UnorderedAccessView **ppUnorderedAccessViews); - void CSGetShader( - [out] ID3D11ComputeShader **ppComputeShader, - [out] ID3D11ClassInstance **ppClassInstances, - [in, out] UINT *pNumClassInstances); - void CSGetSamplers( - [in] UINT StartSlot, - [in] UINT NumSamplers, - [out] ID3D11SamplerState **ppSamplers); - void CSGetConstantBuffers( - [in] UINT StartSlot, - [in] UINT NumBuffers, - [out] ID3D11Buffer **ppConstantBuffers); - void ClearState(); - void Flush(); - D3D11_DEVICE_CONTEXT_TYPE GetType(); - UINT GetContextFlags(); - HRESULT FinishCommandList( - BOOL RestoreDeferredContextState, - [out] ID3D11CommandList **ppCommandList); -} - -[ - object, - uuid(3015a308-dcbd-47aa-a747-192486d14d4a), - local, - pointer_default(unique) -] -interface ID3D11AuthenticatedChannel : ID3D11DeviceChild -{ - HRESULT GetCertificateSize( - UINT *pCertificateSize); - HRESULT GetCertificate( - UINT CertificateSize, - BYTE *pCertificate); - void GetChannelHandle( - HANDLE *pChannelHandle); -} - -[ - object, - uuid(9b32f9ad-bdcc-40a6-a39d-d5c865845720), - local, - pointer_default(unique) -] -interface ID3D11CryptoSession : ID3D11DeviceChild -{ - void GetCryptoType( - GUID *pCryptoType); - void GetDecoderProfile( - GUID *pDecoderProfile); - HRESULT GetCertificateSize( - UINT *pCertificateSize); - HRESULT GetCertificate( - UINT CertificateSize, - BYTE *pCertificate); - void GetCryptoSessionHandle( - HANDLE *pCryptoSessionHandle); -} - -[ - object, - uuid(3c9c5b51-995d-48d1-9b8d-fa5caeded65c), - local, - pointer_default(unique) -] -interface ID3D11VideoDecoder : ID3D11DeviceChild -{ - HRESULT GetCreationParameters( - D3D11_VIDEO_DECODER_DESC *pVideoDesc, - D3D11_VIDEO_DECODER_CONFIG *pConfig); - HRESULT GetDriverHandle( - HANDLE *pDriverHandle); -} - -[ - object, - uuid(31627037-53ab-4200-9061-05faa9ab45f9), - local, - pointer_default(unique) -] -interface ID3D11VideoProcessorEnumerator : ID3D11DeviceChild -{ - HRESULT GetVideoProcessorContentDesc( - D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pContentDesc); - HRESULT CheckVideoProcessorFormat( - DXGI_FORMAT Format, - UINT *pFlags); - HRESULT GetVideoProcessorCaps( - D3D11_VIDEO_PROCESSOR_CAPS *pCaps); - HRESULT GetVideoProcessorRateConversionCaps( - UINT TypeIndex, - D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps); - HRESULT GetVideoProcessorCustomRate( - UINT TypeIndex, - UINT CustomRateIndex, - D3D11_VIDEO_PROCESSOR_CUSTOM_RATE *pRate); - HRESULT GetVideoProcessorFilterRange( - D3D11_VIDEO_PROCESSOR_FILTER Filter, - D3D11_VIDEO_PROCESSOR_FILTER_RANGE *pRange); -} - -[ - object, - uuid(1d7b0652-185f-41c6-85ce-0c5be3d4ae6c), - local, - pointer_default(unique) -] -interface ID3D11VideoProcessor : ID3D11DeviceChild -{ - void GetContentDesc( - D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc); - void GetRateConversionCaps( - D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps); -} - -[ - object, - uuid(c2931aea-2a85-4f20-860f-fba1fd256e18), - local, - pointer_default(unique) -] -interface ID3D11VideoDecoderOutputView : ID3D11View -{ - void GetDesc( - D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc); -} - -[ - object, - uuid(11ec5a5f-51dc-4945-ab34-6e8c21300ea5), - local, - pointer_default(unique) -] -interface ID3D11VideoProcessorInputView : ID3D11View -{ - void GetDesc( - D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc); -} - -[ - object, - uuid(a048285e-25a9-4527-bd93-d68b68c44254), - local, - pointer_default(unique) -] -interface ID3D11VideoProcessorOutputView : ID3D11View -{ - void GetDesc( - D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc); -} - -[ - object, - uuid(10ec4d5b-975a-4689-b9e4-d0aac30fe333), - local, - pointer_default(unique) -] -interface ID3D11VideoDevice : IUnknown -{ - HRESULT CreateVideoDecoder( - const D3D11_VIDEO_DECODER_DESC *pVideoDesc, - const D3D11_VIDEO_DECODER_CONFIG *pConfig, - ID3D11VideoDecoder **ppDecoder); - HRESULT CreateVideoProcessor( - ID3D11VideoProcessorEnumerator *pEnum, - UINT RateConversionIndex, - ID3D11VideoProcessor **ppVideoProcessor); - HRESULT CreateAuthenticatedChannel( - D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType, - ID3D11AuthenticatedChannel **ppAuthenticatedChannel); - HRESULT CreateCryptoSession( - const GUID *pCryptoType, - const GUID *pDecoderProfile, - const GUID *pKeyExchangeType, - ID3D11CryptoSession **ppCryptoSession); - HRESULT CreateVideoDecoderOutputView( - ID3D11Resource *pResource, - const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc, - ID3D11VideoDecoderOutputView **ppVDOVView); - HRESULT CreateVideoProcessorInputView( - ID3D11Resource *pResource, - ID3D11VideoProcessorEnumerator *pEnum, - const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc, - ID3D11VideoProcessorInputView **ppVPIView); - HRESULT CreateVideoProcessorOutputView( - ID3D11Resource *pResource, - ID3D11VideoProcessorEnumerator *pEnum, - const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc, - ID3D11VideoProcessorOutputView **ppVPOView); - HRESULT CreateVideoProcessorEnumerator( - const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc, - ID3D11VideoProcessorEnumerator **ppEnum); - UINT GetVideoDecoderProfileCount(); - HRESULT GetVideoDecoderProfile( - UINT Index, - GUID *pDecoderProfile); - HRESULT CheckVideoDecoderFormat( - const GUID *pDecoderProfile, - DXGI_FORMAT Format, - BOOL *pSupported); - HRESULT GetVideoDecoderConfigCount( - const D3D11_VIDEO_DECODER_DESC *pDesc, - UINT *pCount); - HRESULT GetVideoDecoderConfig( - const D3D11_VIDEO_DECODER_DESC *pDesc, - UINT Index, - D3D11_VIDEO_DECODER_CONFIG *pConfig); - HRESULT GetContentProtectionCaps( - const GUID *pCryptoType, - const GUID *pDecoderProfile, - D3D11_VIDEO_CONTENT_PROTECTION_CAPS *pCaps); - HRESULT CheckCryptoKeyExchange( - const GUID *pCryptoType, - const GUID *pDecoderProfile, - UINT Index, - GUID *pKeyExchangeType); - HRESULT SetPrivateData( - REFGUID guid, - UINT DataSize, - const void *pData); - HRESULT SetPrivateDataInterface( - REFGUID guid, - const IUnknown *pData); -} - -[ - object, - uuid(61f21c45-3c0e-4a74-9cea-67100d9ad5e4), - local, - pointer_default(unique) -] -interface ID3D11VideoContext : ID3D11DeviceChild -{ - HRESULT GetDecoderBuffer( - [in] ID3D11VideoDecoder *decoder, - [in] D3D11_VIDEO_DECODER_BUFFER_TYPE type, - [out] UINT *buffer_size, - [out] void **buffer - ); - HRESULT ReleaseDecoderBuffer( - [in] ID3D11VideoDecoder *decoder, - [in] D3D11_VIDEO_DECODER_BUFFER_TYPE type - ); - HRESULT DecoderBeginFrame( - [in] ID3D11VideoDecoder *decoder, - [in] ID3D11VideoDecoderOutputView *view, - [in] UINT key_size, - [in] const void *key - ); - HRESULT DecoderEndFrame( - [in] ID3D11VideoDecoder *decoder - ); - HRESULT SubmitDecoderBuffers( - [in] ID3D11VideoDecoder *decoder, - [in] UINT buffers_count, - [in] const D3D11_VIDEO_DECODER_BUFFER_DESC *buffer_desc - ); - HRESULT DecoderExtension( - [in] ID3D11VideoDecoder *decoder, - [in] const D3D11_VIDEO_DECODER_EXTENSION *extension - ); - void VideoProcessorSetOutputTargetRect( - [in] ID3D11VideoProcessor *processor, - [in] BOOL enable, - [in] const RECT *rect - ); - void VideoProcessorSetOutputBackgroundColor( - [in] ID3D11VideoProcessor *processor, - [in] BOOL y_cb_cr, - [in] const D3D11_VIDEO_COLOR *color - ); - void VideoProcessorSetOutputColorSpace( - [in] ID3D11VideoProcessor *processor, - [in] const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *color_space - ); - void VideoProcessorSetOutputAlphaFillMode( - [in] ID3D11VideoProcessor *processor, - [in] D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE alpha_fill_mode, - [in] UINT stream_idx - ); - void VideoProcessorSetOutputConstriction( - [in] ID3D11VideoProcessor *processor, - [in] BOOL enable, - [in] SIZE size - ); - void VideoProcessorSetOutputStereoMode( - [in] ID3D11VideoProcessor *processor, - [in] BOOL enable - ); - HRESULT VideoProcessorSetOutputExtension( - [in] ID3D11VideoProcessor *processor, - [in] const GUID *guid, - [in] UINT data_size, - [in] void *data - ); - void VideoProcessorGetOutputTargetRect( - [in] ID3D11VideoProcessor *processor, - [out] BOOL *enabled, - [out] RECT *rect - ); - void VideoProcessorGetOutputBackgroundColor( - [in] ID3D11VideoProcessor *processor, - [out] BOOL *y_cb_cr, - [out] D3D11_VIDEO_COLOR *color - ); - void VideoProcessorGetOutputColorSpace( - [in] ID3D11VideoProcessor *processor, - [out] D3D11_VIDEO_PROCESSOR_COLOR_SPACE *color_space - ); - void VideoProcessorGetOutputAlphaFillMode( - [in] ID3D11VideoProcessor *processor, - [out] D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE *alpha_fill_mode, - [out] UINT *stream_idx - ); - void VideoProcessorGetOutputConstriction( - [in] ID3D11VideoProcessor *processor, - [out] BOOL *enabled, - [out] SIZE *size - ); - void VideoProcessorGetOutputStereoMode( - [in] ID3D11VideoProcessor *processor, - [out] BOOL *enabled - ); - HRESULT VideoProcessorGetOutputExtension( - [in] ID3D11VideoProcessor *processor, - [in] const GUID *guid, - [in] UINT data_size, - [out] void *data - ); - void VideoProcessorSetStreamFrameFormat( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] D3D11_VIDEO_FRAME_FORMAT format - ); - void VideoProcessorSetStreamColorSpace( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *color_space - ); - void VideoProcessorSetStreamOutputRate( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] D3D11_VIDEO_PROCESSOR_OUTPUT_RATE rate, - [in] BOOL repeat, - [in] const DXGI_RATIONAL *custom_rate - ); - void VideoProcessorSetStreamSourceRect( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] const RECT *rect - ); - void VideoProcessorSetStreamDestRect( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] const RECT *rect - ); - void VideoProcessorSetStreamAlpha( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] float alpha - ); - void VideoProcessorSetStreamPalette( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] UINT entry_count, - [in] const UINT *entries - ); - void VideoProcessorSetStreamPixelAspectRatio( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] const DXGI_RATIONAL *src_aspect_ratio, - [in] const DXGI_RATIONAL *dst_aspect_ratio - ); - void VideoProcessorSetStreamLumaKey( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] float lower, - [in] float upper - ); - void VideoProcessorSetStreamStereoFormat( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] D3D11_VIDEO_PROCESSOR_STEREO_FORMAT format, - [in] BOOL left_view_frame0, - [in] BOOL base_view_frame0, - [in] D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE flip_mode, - [in] int mono_offset - ); - void VideoProcessorSetStreamAutoProcessingMode( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable - ); - void VideoProcessorSetStreamFilter( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] D3D11_VIDEO_PROCESSOR_FILTER filter, - [in] BOOL enable, - [in] int level - ); - HRESULT VideoProcessorSetStreamExtension( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] const GUID *guid, - [in] UINT data_size, - [in] void *data - ); - void VideoProcessorGetStreamFrameFormat( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] D3D11_VIDEO_FRAME_FORMAT *format - ); - void VideoProcessorGetStreamColorSpace( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] D3D11_VIDEO_PROCESSOR_COLOR_SPACE *color_space - ); - void VideoProcessorGetStreamOutputRate( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] D3D11_VIDEO_PROCESSOR_OUTPUT_RATE *rate, - [out] BOOL *repeat, - [out] DXGI_RATIONAL *custom_rate - ); - void VideoProcessorGetStreamSourceRect( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] RECT *rect - ); - void VideoProcessorGetStreamDestRect( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] RECT *rect - ); - void VideoProcessorGetStreamAlpha( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] float *alpha - ); - void VideoProcessorGetStreamPalette( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] UINT entry_count, - [out] UINT *entries - ); - void VideoProcessorGetStreamPixelAspectRatio( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] DXGI_RATIONAL *src_aspect_ratio, - [out] DXGI_RATIONAL *dst_aspect_ratio - ); - void VideoProcessorGetStreamLumaKey( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] float *lower, - [out] float *upper - ); - void VideoProcessorGetStreamStereoFormat( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled, - [out] D3D11_VIDEO_PROCESSOR_STEREO_FORMAT *format, - [out] BOOL *left_view_frame0, - [out] BOOL *base_view_frame0, - [out] D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE *flip_mode, - [out] int *mono_offset - ); - void VideoProcessorGetStreamAutoProcessingMode( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enabled - ); - void VideoProcessorGetStreamFilter( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] D3D11_VIDEO_PROCESSOR_FILTER filter, - [out] BOOL *enabled, - [out] int *level - ); - HRESULT VideoProcessorGetStreamExtension( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] const GUID *guid, - [in] UINT data_size, - [out] void *data - ); - HRESULT VideoProcessorBlt( - [in] ID3D11VideoProcessor *processor, - [in] ID3D11VideoProcessorOutputView *view, - [in] UINT frame_idx, - [in] UINT stream_count, - [in] const D3D11_VIDEO_PROCESSOR_STREAM *streams - ); - HRESULT NegotiateCryptoSessionKeyExchange( - [in] ID3D11CryptoSession *session, - [in] UINT data_size, - [in, out] void *data - ); - void EncryptionBlt( - [in] ID3D11CryptoSession *session, - [in] ID3D11Texture2D *src_surface, - [in] ID3D11Texture2D *dst_surface, - [in] UINT iv_size, - [in, out] void *iv - ); - void DecryptionBlt( - [in] ID3D11CryptoSession *session, - [in] ID3D11Texture2D *src_surface, - [in] ID3D11Texture2D *dst_surface, - [in] D3D11_ENCRYPTED_BLOCK_INFO *block_info, - [in] UINT key_size, - [in] const void *key, - [in] UINT iv_size, - [in, out] void *iv - ); - void StartSessionKeyRefresh( - [in] ID3D11CryptoSession *session, - [in] UINT random_number_size, - [out] void *random_number - ); - void FinishSessionKeyRefresh( - [in] ID3D11CryptoSession *session - ); - HRESULT GetEncryptionBltKey( - [in] ID3D11CryptoSession *session, - [in] UINT key_size, - [out] void *key - ); - HRESULT NegotiateAuthenticatedChannelKeyExchange( - [in] ID3D11AuthenticatedChannel *channel, - [in] UINT data_size, - [in, out] void *data - ); - HRESULT QueryAuthenticatedChannel( - [in] ID3D11AuthenticatedChannel *channel, - [in] UINT input_size, - [in] const void *input, - [in] UINT output_size, - [out] void *output - ); - HRESULT ConfigureAuthenticatedChannel( - [in] ID3D11AuthenticatedChannel *channel, - [in] UINT input_size, - [in] const void *input, - [out] D3D11_AUTHENTICATED_CONFIGURE_OUTPUT *output - ); - void VideoProcessorSetStreamRotation( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [in] BOOL enable, - [in] D3D11_VIDEO_PROCESSOR_ROTATION rotation - ); - void VideoProcessorGetStreamRotation( - [in] ID3D11VideoProcessor *processor, - [in] UINT stream_idx, - [out] BOOL *enable, - [out] D3D11_VIDEO_PROCESSOR_ROTATION *rotation - ); -} - -[ - object, - local, - uuid(db6f6ddb-ac77-4e88-8253-819df9bbf140) -] -interface ID3D11Device : IUnknown -{ - HRESULT CreateBuffer( - [in] const D3D11_BUFFER_DESC *pDesc, - [in] const D3D11_SUBRESOURCE_DATA *pInitialData, - [out] ID3D11Buffer **ppBuffer); - HRESULT CreateTexture1D( - [in] const D3D11_TEXTURE1D_DESC *pDesc, - [in] const D3D11_SUBRESOURCE_DATA *pInitialData, - [out] ID3D11Texture1D **ppTexture1D); - HRESULT CreateTexture2D( - [in] const D3D11_TEXTURE2D_DESC *pDesc, - [in] const D3D11_SUBRESOURCE_DATA *pInitialData, - [out] ID3D11Texture2D **ppTexture2D); - HRESULT CreateTexture3D( - [in] const D3D11_TEXTURE3D_DESC *pDesc, - [in] const D3D11_SUBRESOURCE_DATA *pInitialData, - [out] ID3D11Texture3D **ppTexture3D); - HRESULT CreateShaderResourceView( - [in] ID3D11Resource *pResource, - [in] const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, - [out] ID3D11ShaderResourceView **ppSRView); - HRESULT CreateUnorderedAccessView( - [in] ID3D11Resource *pResource, - [in] const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, - [out] ID3D11UnorderedAccessView **ppUAView); - HRESULT CreateRenderTargetView( - [in] ID3D11Resource *pResource, - [in] const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, - [out] ID3D11RenderTargetView **ppRTView); - HRESULT CreateDepthStencilView( - [in] ID3D11Resource *pResource, - [in] const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, - [out] ID3D11DepthStencilView **ppDepthStencilView); - HRESULT CreateInputLayout( - [in] const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, - [in] UINT NumElements, - [in] const void *pShaderBytecodeWithInputSignature, - [in] SIZE_T BytecodeLength, - [out] ID3D11InputLayout **ppInputLayout); - HRESULT CreateVertexShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11VertexShader **ppVertexShader); - HRESULT CreateGeometryShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11GeometryShader **ppGeometryShader); - HRESULT CreateGeometryShaderWithStreamOutput( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, - [in] UINT NumEntries, - [in] const UINT *pBufferStrides, - [in] UINT NumStrides, - [in] UINT RasterizedStream, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11GeometryShader **ppGeometryShader); - HRESULT CreatePixelShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11PixelShader **ppPixelShader); - HRESULT CreateHullShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11HullShader **ppHullShader); - HRESULT CreateDomainShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11DomainShader **ppDomainShader); - HRESULT CreateComputeShader( - [in] const void *pShaderBytecode, - [in] SIZE_T BytecodeLength, - [in] ID3D11ClassLinkage *pClassLinkage, - [out] ID3D11ComputeShader **ppComputeShader); - HRESULT CreateClassLinkage( - [out] ID3D11ClassLinkage **ppLinkage); - HRESULT CreateBlendState( - [in] const D3D11_BLEND_DESC *pBlendStateDesc, - [out] ID3D11BlendState **ppBlendState); - HRESULT CreateDepthStencilState( - [in] const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc, - [out] ID3D11DepthStencilState **ppDepthStencilState); - HRESULT CreateRasterizerState( - [in] const D3D11_RASTERIZER_DESC *pRasterizerDesc, - [out] ID3D11RasterizerState **ppRasterizerState); - HRESULT CreateSamplerState( - [in] const D3D11_SAMPLER_DESC *pSamplerDesc, - [out] ID3D11SamplerState **ppSamplerState); - HRESULT CreateQuery( - [in] const D3D11_QUERY_DESC *pQueryDesc, - [out] ID3D11Query **ppQuery); - HRESULT CreatePredicate( - [in] const D3D11_QUERY_DESC *pPredicateDesc, - [out] ID3D11Predicate **ppPredicate); - HRESULT CreateCounter( - [in] const D3D11_COUNTER_DESC *pCounterDesc, - [out] ID3D11Counter **ppCounter); - HRESULT CreateDeferredContext( - UINT ContextFlags, - [out] ID3D11DeviceContext **ppDeferredContext); - HRESULT OpenSharedResource( - [in] HANDLE hResource, - [in] REFIID ReturnedInterface, - [out] void **ppResource); - HRESULT CheckFormatSupport( - [in] DXGI_FORMAT Format, - [out] UINT *pFormatSupport); - HRESULT CheckMultisampleQualityLevels( - [in] DXGI_FORMAT Format, - [in] UINT SampleCount, - [out] UINT *pNumQualityLevels); - void CheckCounterInfo( - [out] D3D11_COUNTER_INFO *pCounterInfo); - HRESULT CheckCounter( - [in] const D3D11_COUNTER_DESC *pDesc, - [out] D3D11_COUNTER_TYPE *pType, - [out] UINT *pActiveCounters, - [out] LPSTR szName, - [in, out] UINT *pNameLength, - [out] LPSTR szUnits, - [in, out] UINT *pUnitsLength, - [out] LPSTR szDescription, - [in, out] UINT *pDescriptionLength); - HRESULT CheckFeatureSupport( - D3D11_FEATURE Feature, - [out] void *pFeatureSupportData, - UINT FeatureSupportDataSize); - HRESULT GetPrivateData( - [in] REFGUID guid, - [in, out] UINT *pDataSize, - [out] void *pData); - HRESULT SetPrivateData( - [in] REFGUID guid, - [in] UINT DataSize, - [in] const void *pData); - HRESULT SetPrivateDataInterface( - [in] REFGUID guid, - [in] const IUnknown *pData); - D3D_FEATURE_LEVEL GetFeatureLevel(); - UINT GetCreationFlags(); - HRESULT GetDeviceRemovedReason(); - void GetImmediateContext( - [out] ID3D11DeviceContext **ppImmediateContext); - HRESULT SetExceptionMode(UINT RaiseFlags); - UINT GetExceptionMode(); -} - -typedef enum D3D11_CREATE_DEVICE_FLAG { - D3D11_CREATE_DEVICE_SINGLETHREADED = 0x0001, - D3D11_CREATE_DEVICE_DEBUG = 0x0002, - D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x0004, - D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x0008, - D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x0020, - D3D11_CREATE_DEVICE_DEBUGGABLE = 0x0040, - D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x0080, - D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x0100, - D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x0800 -} D3D11_CREATE_DEVICE_FLAG; - -typedef enum D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT -{ - D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT = 0x0001, - D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT = 0x0002, -} D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT; - -const UINT D3D11_SDK_VERSION = 7; - -cpp_quote("#include ") -cpp_quote("#ifndef D3D11_IGNORE_SDK_LAYERS") -cpp_quote("# include ") -cpp_quote("#endif") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") - -const UINT _FACD3D11 = 0x87c; -cpp_quote("#define MAKE_D3D11_HRESULT(code) MAKE_HRESULT(SEVERITY_ERROR, _FACD3D11, code)") - -cpp_quote("typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,") -cpp_quote(" const D3D_FEATURE_LEVEL*,UINT,UINT,ID3D11Device**,D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);") - -cpp_quote("HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,const D3D_FEATURE_LEVEL*," ) -cpp_quote(" UINT,UINT,ID3D11Device**,D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);") - -cpp_quote("typedef HRESULT (WINAPI *PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,") -cpp_quote(" const D3D_FEATURE_LEVEL*,UINT,UINT,const DXGI_SWAP_CHAIN_DESC*,IDXGISwapChain**,ID3D11Device**,") -cpp_quote(" D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);") - -[local] HRESULT __stdcall D3D11CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, - HMODULE swrast, UINT flags, const D3D_FEATURE_LEVEL *feature_levels, UINT levels, UINT sdk_version, - const DXGI_SWAP_CHAIN_DESC *swapchain_desc, IDXGISwapChain **swapchain, ID3D11Device **device, - D3D_FEATURE_LEVEL *obtained_feature_level, ID3D11DeviceContext **immediate_context); diff --git a/wrappers/to-synch/sdk/include/reactos/wine/d3d11sdklayers.idl b/wrappers/to-synch/sdk/include/reactos/wine/d3d11sdklayers.idl deleted file mode 100644 index 54236fcdac7..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/d3d11sdklayers.idl +++ /dev/null @@ -1,1303 +0,0 @@ -/* - * Copyright 2013 Jacek Caban for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "d3d11.idl"; - -const UINT D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP = 0x1; -const UINT D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP = 0x2; -const UINT D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP = 0x4; -const UINT D3D11_DEBUG_FEATURE_ALWAYS_DISCARD_OFFERED_RESOURCE = 0x8; -const UINT D3D11_DEBUG_FEATURE_NEVER_DISCARD_OFFERED_RESOURCE = 0x10; -const UINT D3D11_DEBUG_FEATURE_AVOID_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x40; -const UINT D3D11_DEBUG_FEATURE_DISABLE_TILED_RESOURCE_MAPPING_TRACKING_AND_VALIDATION = 0x80; - -typedef enum D3D11_MESSAGE_CATEGORY { - D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED, - D3D11_MESSAGE_CATEGORY_MISCELLANEOUS, - D3D11_MESSAGE_CATEGORY_INITIALIZATION, - D3D11_MESSAGE_CATEGORY_CLEANUP, - D3D11_MESSAGE_CATEGORY_COMPILATION, - D3D11_MESSAGE_CATEGORY_STATE_CREATION, - D3D11_MESSAGE_CATEGORY_STATE_SETTING, - D3D11_MESSAGE_CATEGORY_STATE_GETTING, - D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION, - D3D11_MESSAGE_CATEGORY_EXECUTION, - D3D11_MESSAGE_CATEGORY_SHADER -} D3D11_MESSAGE_CATEGORY; - -typedef enum D3D11_MESSAGE_SEVERITY { - D3D11_MESSAGE_SEVERITY_CORRUPTION, - D3D11_MESSAGE_SEVERITY_ERROR, - D3D11_MESSAGE_SEVERITY_WARNING, - D3D11_MESSAGE_SEVERITY_INFO, - D3D11_MESSAGE_SEVERITY_MESSAGE -} D3D11_MESSAGE_SEVERITY; - -typedef enum D3D11_MESSAGE_ID { - D3D11_MESSAGE_ID_UNKNOWN = 0, - D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD, - D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD, - D3D11_MESSAGE_ID_STRING_FROM_APPLICATION, - D3D11_MESSAGE_ID_CORRUPTED_THIS, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14, - D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15, - D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING, - D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY, - D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA, - D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA, - D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN, - D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS, - D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS, - D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES, - D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE, - D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS, - D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC, - D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC, - D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS, - D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC, - D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC, - D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE, - D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC, - D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY, - D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS, - D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG, - D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC, - D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED, - D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED, - D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE, - D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID, - D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE, - D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT, - D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR, - D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH, - D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH, - D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID, - D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE, - D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE, - D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE, - D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE, - D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID, - D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID, - D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID, - D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID, - D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID, - D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE, - D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS, - D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED, - D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED, - D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE, - D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS, - D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED, - D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED, - D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE, - D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS, - D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED, - D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED, - D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE, - D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS, - D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED, - D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED, - D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED, - D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED, - D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS, - D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE, - D3D11_MESSAGE_ID_REF_THREADING_MODE, - D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION, - D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION, - D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION, - D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE, - D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER, - D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY, - D3D11_MESSAGE_ID_REF_INFO, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL, - D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL, - D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID, - D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL, - D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT, - D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED, - D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE, - D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER, - D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING, - D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0, - D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT, - D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT, - D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT, - D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN, - D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC, - D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH, - D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW, - D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH, - D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY, - D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY, - D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER, - D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED, - D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER, - D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN, - D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC, - D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER, - D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER, - D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE, - D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED, - D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION, - D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE, - D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS, - D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION, - D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS, - D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN, - D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE, - D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS, - D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL, - D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN, - D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE, - D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT, - D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH, - D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY, - D3D11_MESSAGE_ID_LIVE_BUFFER, - D3D11_MESSAGE_ID_LIVE_TEXTURE1D, - D3D11_MESSAGE_ID_LIVE_TEXTURE2D, - D3D11_MESSAGE_ID_LIVE_TEXTURE3D, - D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW, - D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW, - D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW, - D3D11_MESSAGE_ID_LIVE_VERTEXSHADER, - D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER, - D3D11_MESSAGE_ID_LIVE_PIXELSHADER, - D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT, - D3D11_MESSAGE_ID_LIVE_SAMPLER, - D3D11_MESSAGE_ID_LIVE_BLENDSTATE, - D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE, - D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE, - D3D11_MESSAGE_ID_LIVE_QUERY, - D3D11_MESSAGE_ID_LIVE_PREDICATE, - D3D11_MESSAGE_ID_LIVE_COUNTER, - D3D11_MESSAGE_ID_LIVE_DEVICE, - D3D11_MESSAGE_ID_LIVE_SWAPCHAIN, - D3D11_MESSAGE_ID_D3D10_MESSAGES_END, - - D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x00100000, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE, - D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED, - D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS, - D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D, - D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE, - D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE, - D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS, - D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS, - D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX, - D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS, - D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS, - D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY, - D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK, - D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK, - D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE, - D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES, - D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER, - D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE, - D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT, - D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS, - D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES, - D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED, - D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED, - D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED, - D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED, - D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE, - D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED, - D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3, - D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED, - D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO, - D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION, - D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED, - D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR, - D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA, - D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP, - D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED, - D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT, - D3D11_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES, - D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END, - - D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x00200000, - D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS, - D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS, - D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED, - D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN, - D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT, - D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES, - D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES, - D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL, - D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL, - D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH, - D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT, - D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER, - D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW, - D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE, - D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS, - D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED, - D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN, - D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD, - D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE, - D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED, - D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS, - D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH, - D3D11_MESSAGE_ID_CREATE_CONTEXT, - D3D11_MESSAGE_ID_LIVE_CONTEXT, - D3D11_MESSAGE_ID_DESTROY_CONTEXT, - D3D11_MESSAGE_ID_CREATE_BUFFER, - D3D11_MESSAGE_ID_LIVE_BUFFER_WIN7, - D3D11_MESSAGE_ID_DESTROY_BUFFER, - D3D11_MESSAGE_ID_CREATE_TEXTURE1D, - D3D11_MESSAGE_ID_LIVE_TEXTURE1D_WIN7, - D3D11_MESSAGE_ID_DESTROY_TEXTURE1D, - D3D11_MESSAGE_ID_CREATE_TEXTURE2D, - D3D11_MESSAGE_ID_LIVE_TEXTURE2D_WIN7, - D3D11_MESSAGE_ID_DESTROY_TEXTURE2D, - D3D11_MESSAGE_ID_CREATE_TEXTURE3D, - D3D11_MESSAGE_ID_LIVE_TEXTURE3D_WIN7, - D3D11_MESSAGE_ID_DESTROY_TEXTURE3D, - D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW, - D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW_WIN7, - D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW, - D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW, - D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW_WIN7, - D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW, - D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW, - D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW_WIN7, - D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW, - D3D11_MESSAGE_ID_CREATE_VERTEXSHADER, - D3D11_MESSAGE_ID_LIVE_VERTEXSHADER_WIN7, - D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER, - D3D11_MESSAGE_ID_CREATE_HULLSHADER, - D3D11_MESSAGE_ID_LIVE_HULLSHADER, - D3D11_MESSAGE_ID_DESTROY_HULLSHADER, - D3D11_MESSAGE_ID_CREATE_DOMAINSHADER, - D3D11_MESSAGE_ID_LIVE_DOMAINSHADER, - D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER, - D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER, - D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER_WIN7, - D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER, - D3D11_MESSAGE_ID_CREATE_PIXELSHADER, - D3D11_MESSAGE_ID_LIVE_PIXELSHADER_WIN7, - D3D11_MESSAGE_ID_DESTROY_PIXELSHADER, - D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT, - D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT_WIN7, - D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT, - D3D11_MESSAGE_ID_CREATE_SAMPLER, - D3D11_MESSAGE_ID_LIVE_SAMPLER_WIN7, - D3D11_MESSAGE_ID_DESTROY_SAMPLER, - D3D11_MESSAGE_ID_CREATE_BLENDSTATE, - D3D11_MESSAGE_ID_LIVE_BLENDSTATE_WIN7, - D3D11_MESSAGE_ID_DESTROY_BLENDSTATE, - D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE, - D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE_WIN7, - D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE, - D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE, - D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE_WIN7, - D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE, - D3D11_MESSAGE_ID_CREATE_QUERY, - D3D11_MESSAGE_ID_LIVE_QUERY_WIN7, - D3D11_MESSAGE_ID_DESTROY_QUERY, - D3D11_MESSAGE_ID_CREATE_PREDICATE, - D3D11_MESSAGE_ID_LIVE_PREDICATE_WIN7, - D3D11_MESSAGE_ID_DESTROY_PREDICATE, - D3D11_MESSAGE_ID_CREATE_COUNTER, - D3D11_MESSAGE_ID_DESTROY_COUNTER, - D3D11_MESSAGE_ID_CREATE_COMMANDLIST, - D3D11_MESSAGE_ID_LIVE_COMMANDLIST, - D3D11_MESSAGE_ID_DESTROY_COMMANDLIST, - D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE, - D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE, - D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE, - D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE, - D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE, - D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE, - D3D11_MESSAGE_ID_LIVE_DEVICE_WIN7, - D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY_WIN7, - D3D11_MESSAGE_ID_CREATE_COMPUTESHADER, - D3D11_MESSAGE_ID_LIVE_COMPUTESHADER, - D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER, - D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW, - D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW, - D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA, - D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS, - D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL, - D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE, - D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE, - D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD, - D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD, - D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL, - D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY, - D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE, - D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE, - D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE, - D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER, - D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED, - D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP, - D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD, - D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH, - D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY, - D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS, - D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS, - D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER, - D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED, - D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT, - D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE, - D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD, - D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT, - D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE, - D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY, - D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY, - D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED, - D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW, - D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO, - D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH, - D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED, - D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET, - D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET, - D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE, - D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE, - D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW, - D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET, - D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS, - D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED, - D3D11_MESSAGE_ID_REF_WARNING, - D3D11_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV, - D3D11_MESSAGE_ID_SHADER_ABORT, - D3D11_MESSAGE_ID_SHADER_MESSAGE, - D3D11_MESSAGE_ID_SHADER_ERROR, - D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE, - D3D11_MESSAGE_ID_HSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_DSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CSSETSAMPLERS_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_HSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_DSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_CSSETSHADER_UNBINDDELETINGOBJECT, - D3D11_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN, - D3D11_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NUMUAVS_INVALIDRANGE, - D3D11_MESSAGE_ID_D3D11_MESSAGES_END, - - D3D11_MESSAGE_ID_D3D11_1_MESSAGES_START = 0x00300000, - D3D11_MESSAGE_ID_CREATE_VIDEODECODER, - D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSORENUM, - D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSOR, - D3D11_MESSAGE_ID_CREATE_DECODEROUTPUTVIEW, - D3D11_MESSAGE_ID_CREATE_PROCESSORINPUTVIEW, - D3D11_MESSAGE_ID_CREATE_PROCESSOROUTPUTVIEW, - D3D11_MESSAGE_ID_CREATE_DEVICECONTEXTSTATE, - D3D11_MESSAGE_ID_LIVE_VIDEODECODER, - D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSORENUM, - D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSOR, - D3D11_MESSAGE_ID_LIVE_DECODEROUTPUTVIEW, - D3D11_MESSAGE_ID_LIVE_PROCESSORINPUTVIEW, - D3D11_MESSAGE_ID_LIVE_PROCESSOROUTPUTVIEW, - D3D11_MESSAGE_ID_LIVE_DEVICECONTEXTSTATE, - D3D11_MESSAGE_ID_DESTROY_VIDEODECODER, - D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSORENUM, - D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSOR, - D3D11_MESSAGE_ID_DESTROY_DECODEROUTPUTVIEW, - D3D11_MESSAGE_ID_DESTROY_PROCESSORINPUTVIEW, - D3D11_MESSAGE_ID_DESTROY_PROCESSOROUTPUTVIEW, - D3D11_MESSAGE_ID_DESTROY_DEVICECONTEXTSTATE, - D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFLAGS, - D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFEATURELEVEL, - D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_FEATURELEVELS_NOT_SUPPORTED, - D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDREFIID, - D3D11_MESSAGE_ID_DEVICE_DISCARDVIEW_INVALIDVIEW, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION1_INVALIDCOPYFLAGS, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE1_INVALIDCOPYFLAGS, - D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_NULLPARAM, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_ZEROWIDTHHEIGHT, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERSIZE, - D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERUSAGE, - D3D11_MESSAGE_ID_GETVIDEODECODERPROFILECOUNT_OUTOFMEMORY, - D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_INVALIDINDEX, - D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_INVALIDINDEX, - D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_GETDECODERCREATIONPARAMS_NULLPARAM, - D3D11_MESSAGE_ID_GETDECODERDRIVERHANDLE_NULLPARAM, - D3D11_MESSAGE_ID_GETDECODERBUFFER_NULLPARAM, - D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDBUFFER, - D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDTYPE, - D3D11_MESSAGE_ID_GETDECODERBUFFER_LOCKED, - D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NULLPARAM, - D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_INVALIDTYPE, - D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NOTLOCKED, - D3D11_MESSAGE_ID_DECODERBEGINFRAME_NULLPARAM, - D3D11_MESSAGE_ID_DECODERBEGINFRAME_HAZARD, - D3D11_MESSAGE_ID_DECODERENDFRAME_NULLPARAM, - D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_NULLPARAM, - D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_INVALIDTYPE, - D3D11_MESSAGE_ID_DECODEREXTENSION_NULLPARAM, - D3D11_MESSAGE_ID_DECODEREXTENSION_INVALIDRESOURCE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_NULLPARAM, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDFRAMEFORMAT, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDUSAGE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDINPUTFRAMERATE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDOUTPUTFRAMERATE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDWIDTHHEIGHT, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORCONTENTDESC_NULLPARAM, - D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORCAPS_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_INVALIDINDEX, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_INVALIDINDEX, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_NULLPARAM, - D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_UNSUPPORTED, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTTARGETRECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_INVALIDALPHA, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDFILLMODE, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTEXTENSION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTTARGETRECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTBACKGROUNDCOLOR_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTALPHAFILLMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCONSTRICTION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_INVALIDSIZE, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSTEREOMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTEXTENSION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDFORMAT, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDRATE, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDFLAG, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDRECT, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDRECT, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDALPHA, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDCOUNT, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDALPHA, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDRATIO, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDRANGE, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FLIPUNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_MONOOFFSETUNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FORMATUNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDFORMAT, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDFILTER, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDLEVEL, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSTREAMCOUNT, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_TARGETRECT, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDOUTPUT, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDPASTFRAMES, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDFUTUREFRAMES, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSOURCERECT, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDDESTRECT, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDINPUTRESOURCE, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAYSIZE, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAY, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTEXPECTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTNOTEXPECTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_STEREONOTENABLED, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDRIGHTRESOURCE, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NOSTEREOSTREAMS, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INPUTHAZARD, - D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_OUTPUTHAZARD, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_NULLPARAM, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDTYPE, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDBIND, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEDFORMAT, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDMIP, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEMIP, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAYSIZE, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY, - D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDDIMENSION, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_NULLPARAM, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDTYPE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDBIND, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMISC, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDUSAGE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFOURCC, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMIP, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_UNSUPPORTEDMIP, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAYSIZE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAY, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDDIMENSION, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_NULLPARAM, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDTYPE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDBIND, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDFORMAT, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMIP, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDMIP, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDARRAY, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDARRAY, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDDIMENSION, - D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT, - D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS, - D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER, - D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER, - D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER, - D3D11_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE, - D3D11_MESSAGE_ID_REF_WARNING_ATOMIC_INCONSISTENT, - D3D11_MESSAGE_ID_REF_WARNING_READING_UNINITIALIZED_RESOURCE, - D3D11_MESSAGE_ID_REF_WARNING_RAW_HAZARD, - D3D11_MESSAGE_ID_REF_WARNING_WAR_HAZARD, - D3D11_MESSAGE_ID_REF_WARNING_WAW_HAZARD, - D3D11_MESSAGE_ID_CREATECRYPTOSESSION_NULLPARAM, - D3D11_MESSAGE_ID_CREATECRYPTOSESSION_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_GETCRYPTOTYPE_NULLPARAM, - D3D11_MESSAGE_ID_GETDECODERPROFILE_NULLPARAM, - D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATESIZE_NULLPARAM, - D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_NULLPARAM, - D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_WRONGSIZE, - D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_WRONGSIZE, - D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_NULLPARAM, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_UNSUPPORTED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_NULLPARAM, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_WRONGDEVICE, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_WRONGDEVICE, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_FORMAT_MISMATCH, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SIZE_MISMATCH, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MULTISAMPLED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_NOT_STAGING, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MAPPED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_MAPPED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_OFFERED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_OFFERED, - D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_CONTENT_UNDEFINED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_UNSUPPORTED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_NULLPARAM, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_WRONGDEVICE, - D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_WRONGDEVICE, - D3D11_MESSAGE_ID_DECRYPTIONBLT_FORMAT_MISMATCH, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SIZE_MISMATCH, - D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MULTISAMPLED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_NOT_STAGING, - D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_NOT_RENDER_TARGET, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_MAPPED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MAPPED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_OFFERED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_OFFERED, - D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_CONTENT_UNDEFINED, - D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_NULLPARAM, - D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_INVALIDSIZE, - D3D11_MESSAGE_ID_FINISHSESSIONKEYREFRESH_NULLPARAM, - D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_NULLPARAM, - D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_INVALIDSIZE, - D3D11_MESSAGE_ID_GETCONTENTPROTECTIONCAPS_NULLPARAM, - D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_NULLPARAM, - D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_INVALIDINDEX, - D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_NULLPARAM, - D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_UNSUPPORTED, - D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_INVALIDTYPE, - D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_OUTOFMEMORY_RETURN, - D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_INVALIDCHANNEL, - D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_NULLPARAM, - D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_INVALIDCHANNEL, - D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_NULLPARAM, - D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_WRONGSIZE, - D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDCHANNEL, - D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_NULLPARAM, - D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_NULLPARAM, - D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGCHANNEL, - D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_UNSUPPORTEDQUERY, - D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGSIZE, - D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_INVALIDPROCESSINDEX, - D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_NULLPARAM, - D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGCHANNEL, - D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_UNSUPPORTEDCONFIGURE, - D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGSIZE, - D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_INVALIDPROCESSIDTYPE, - D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT, - D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_INVALIDSIZE, - D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDSIZE, - D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY, - D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_OUTOFMEMORY, - D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_NULLPARAM, - D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDTYPE, - D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDBIND, - D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDARRAY, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_NULLPARAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALIDSTREAM, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALID, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_NULLPARAM, - D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW, - D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED, - D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_UNSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET, - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS, - D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED, - D3D11_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1, - D3D11_MESSAGE_ID_GETDC_INACCESSIBLE, - D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT, - D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9, - D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED, - D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED, - D3D11_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED, - D3D11_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED, - D3D11_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA, - D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA, - D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT, - D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT, - D3D11_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX, - D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX, - D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS, - D3D11_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET, - D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT, - D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT, - D3D11_MESSAGE_ID_D3D11_1_MESSAGES_END -} D3D11_MESSAGE_ID; - -typedef enum D3D11_RLDO_FLAGS { - D3D11_RLDO_SUMMARY = 1, - D3D11_RLDO_DETAIL = 2 -} D3D11_RLDO_FLAGS; - -typedef struct D3D11_MESSAGE { - D3D11_MESSAGE_CATEGORY Category; - D3D11_MESSAGE_SEVERITY Severity; - D3D11_MESSAGE_ID ID; - const char *pDescription; - SIZE_T DescriptionByteLength; -} D3D11_MESSAGE; - -typedef struct D3D11_INFO_QUEUE_FILTER_DESC { - UINT NumCategories; - D3D11_MESSAGE_CATEGORY *pCategoryList; - UINT NumSeverities; - D3D11_MESSAGE_SEVERITY *pSeverityList; - UINT NumIDs; - D3D11_MESSAGE_ID *pIDList; -} D3D11_INFO_QUEUE_FILTER_DESC; - -typedef struct D3D11_INFO_QUEUE_FILTER { - D3D11_INFO_QUEUE_FILTER_DESC AllowList; - D3D11_INFO_QUEUE_FILTER_DESC DenyList; -} D3D11_INFO_QUEUE_FILTER; - -cpp_quote("#define D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024") - -[ - object, - uuid(79cf2233-7536-4948-9d36-1e4692dc5760), - local, - pointer_default(unique) -] -interface ID3D11Debug : IUnknown { - HRESULT SetFeatureMask(UINT Mask); - UINT GetFeatureMask(); - HRESULT SetPresentPerRenderOpDelay(UINT Milliseconds); - UINT GetPresentPerRenderOpDelay(); - HRESULT SetSwapChain(IDXGISwapChain *pSwapChain); - HRESULT GetSwapChain(IDXGISwapChain **ppSwapChain); - HRESULT ValidateContext(ID3D11DeviceContext *pContext); - HRESULT ReportLiveDeviceObjects(D3D11_RLDO_FLAGS Flags); - HRESULT ValidateContextForDispatch(ID3D11DeviceContext *pContext); -} - -[ - object, - uuid(1ef337e3-58e7-4f83-a692-db221f5ed47e), - local, - pointer_default(unique) -] -interface ID3D11SwitchToRef : IUnknown { - BOOL SetUseRef( - [in] BOOL useref - ); - BOOL GetUseRef(); -} - -[ - object, - uuid(6543dbb6-1b48-42f5-ab82-e97ec74326f6), - local, - pointer_default(unique) -] -interface ID3D11InfoQueue : IUnknown { - HRESULT SetMessageCountLimit(UINT64 MessageCountLimit); - void ClearStoredMessages(); - -cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") -cpp_quote("#undef GetMessage") -cpp_quote("#endif") - HRESULT GetMessage(UINT64 MessageIndex, D3D11_MESSAGE* pMessage, SIZE_T *pMessageByteLength); - - UINT64 GetNumMessagesAllowedByStorageFilter(); - UINT64 GetNumMessagesDeniedByStorageFilter(); - UINT64 GetNumStoredMessages(); - UINT64 GetNumStoredMessagesAllowedByRetrievalFilter(); - UINT64 GetNumMessagesDiscardedByMessageCountLimit(); - UINT64 GetMessageCountLimit(); - HRESULT AddStorageFilterEntries(D3D11_INFO_QUEUE_FILTER *pFilter); - HRESULT GetStorageFilter(D3D11_INFO_QUEUE_FILTER *pFilter, SIZE_T *pFilterByteLength); - void ClearStorageFilter(); - HRESULT PushEmptyStorageFilter(); - HRESULT PushCopyOfStorageFilter(); - HRESULT PushStorageFilter(D3D11_INFO_QUEUE_FILTER *pFilter); - void PopStorageFilter(); - UINT GetStorageFilterStackSize(); - HRESULT AddRetrievalFilterEntries(D3D11_INFO_QUEUE_FILTER *pFilter); - HRESULT GetRetrievalFilter(D3D11_INFO_QUEUE_FILTER *pFilter, SIZE_T *pFilterByteLength); - void ClearRetrievalFilter(); - HRESULT PushEmptyRetrievalFilter(); - HRESULT PushCopyOfRetrievalFilter(); - HRESULT PushRetrievalFilter(D3D11_INFO_QUEUE_FILTER *pFilter); - void PopRetrievalFilter(); - UINT GetRetrievalFilterStackSize(); - HRESULT AddMessage(D3D11_MESSAGE_CATEGORY Category, D3D11_MESSAGE_SEVERITY Severity, - D3D11_MESSAGE_ID ID, LPCSTR pDescription); - HRESULT AddApplicationMessage(D3D11_MESSAGE_SEVERITY Severity, LPCSTR pDescription); - HRESULT SetBreakOnCategory(D3D11_MESSAGE_CATEGORY Category, BOOL bEnable); - HRESULT SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY Severity, BOOL bEnable); - HRESULT SetBreakOnID(D3D11_MESSAGE_ID ID, BOOL bEnable); - BOOL GetBreakOnCategory(D3D11_MESSAGE_CATEGORY Category); - BOOL GetBreakOnSeverity(D3D11_MESSAGE_SEVERITY Severity); - BOOL GetBreakOnID(D3D11_MESSAGE_ID ID); - void SetMuteDebugOutput(BOOL bMute); - BOOL GetMuteDebugOutput(); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/dxgi.idl b/wrappers/to-synch/sdk/include/reactos/wine/dxgi.idl deleted file mode 100644 index 65c5a4b9d49..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/dxgi.idl +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Copyright 2007 Andras Kovacs - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgitype.idl"; - -const UINT _FACDXGI = 0x87a; - -cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)") -cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)") - -cpp_quote("#if 0") -typedef HANDLE HMONITOR; -typedef struct _LUID { - DWORD LowPart; - LONG HighPart; -} LUID, *PLUID; -cpp_quote("#endif") - -const UINT DXGI_CPU_ACCESS_NONE = 0; -const UINT DXGI_CPU_ACCESS_DYNAMIC = 1; -const UINT DXGI_CPU_ACCESS_READ_WRITE = 2; -const UINT DXGI_CPU_ACCESS_SCRATCH = 3; -const UINT DXGI_CPU_ACCESS_FIELD = 15; - -typedef UINT DXGI_USAGE; -const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L; -const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L; -const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L; -const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L; -const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L; -const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L; -const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L; - -const UINT DXGI_ENUM_MODES_INTERLACED = 1; -const UINT DXGI_ENUM_MODES_SCALING = 2; - -const UINT DXGI_RESOURCE_PRIORITY_MINIMUM = 0x28000000; -const UINT DXGI_RESOURCE_PRIORITY_LOW = 0x50000000; -const UINT DXGI_RESOURCE_PRIORITY_NORMAL = 0x78000000; -const UINT DXGI_RESOURCE_PRIORITY_HIGH = 0xa0000000; -const UINT DXGI_RESOURCE_PRIORITY_MAXIMUM = 0xc8000000; - -const UINT DXGI_MAP_READ = 0x1; -const UINT DXGI_MAP_WRITE = 0x2; -const UINT DXGI_MAP_DISCARD = 0x4; - -typedef enum DXGI_SWAP_EFFECT { - DXGI_SWAP_EFFECT_DISCARD = 0, - DXGI_SWAP_EFFECT_SEQUENTIAL = 1, - DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3, - DXGI_SWAP_EFFECT_FLIP_DISCARD = 4 -} DXGI_SWAP_EFFECT; - -typedef enum DXGI_RESIDENCY { - DXGI_RESIDENCY_FULLY_RESIDENT = 1, - DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2, - DXGI_RESIDENCY_EVICTED_TO_DISK = 3, -} DXGI_RESIDENCY; - -typedef struct DXGI_SURFACE_DESC { - UINT Width; - UINT Height; - DXGI_FORMAT Format; - DXGI_SAMPLE_DESC SampleDesc; -} DXGI_SURFACE_DESC; - -typedef struct DXGI_MAPPED_RECT { - INT Pitch; - BYTE *pBits; -} DXGI_MAPPED_RECT; - -typedef struct DXGI_OUTPUT_DESC { - WCHAR DeviceName[32]; - RECT DesktopCoordinates; - BOOL AttachedToDesktop; - DXGI_MODE_ROTATION Rotation; - HMONITOR Monitor; -} DXGI_OUTPUT_DESC; - -typedef struct DXGI_FRAME_STATISTICS { - UINT PresentCount; - UINT PresentRefreshCount; - UINT SyncRefreshCount; - LARGE_INTEGER SyncQPCTime; - LARGE_INTEGER SyncGPUTime; -} DXGI_FRAME_STATISTICS; - -typedef struct DXGI_ADAPTER_DESC { - WCHAR Description[128]; - UINT VendorId; - UINT DeviceId; - UINT SubSysId; - UINT Revision; - SIZE_T DedicatedVideoMemory; - SIZE_T DedicatedSystemMemory; - SIZE_T SharedSystemMemory; - LUID AdapterLuid; -} DXGI_ADAPTER_DESC; - -typedef enum DXGI_SWAP_CHAIN_FLAG -{ - DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 0x0001, - DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 0x0002, - DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 0x0004, - DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 0x0008, - DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 0x0010, - DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 0x0020, - DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 0x0040, - DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 0x0080, - DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 0x0100, - DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 0x0200, - DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 0x0400, - DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 0x0800, - DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 0x1000, -} DXGI_SWAP_CHAIN_FLAG; - -typedef struct DXGI_SWAP_CHAIN_DESC { - DXGI_MODE_DESC BufferDesc; - DXGI_SAMPLE_DESC SampleDesc; - DXGI_USAGE BufferUsage; - UINT BufferCount; - HWND OutputWindow; - BOOL Windowed; - DXGI_SWAP_EFFECT SwapEffect; - UINT Flags; -} DXGI_SWAP_CHAIN_DESC; - -typedef struct DXGI_SHARED_RESOURCE { - HANDLE Handle; -} DXGI_SHARED_RESOURCE; - -[ - object, - local, - uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e) -] -interface IDXGIObject : IUnknown -{ - HRESULT SetPrivateData( - [in] REFGUID guid, - [in] UINT data_size, - [in] const void *data - ); - HRESULT SetPrivateDataInterface( - [in] REFGUID guid, - [in] const IUnknown *object - ); - HRESULT GetPrivateData( - [in] REFGUID guid, - [in, out] UINT *data_size, - [out] void *data - ); - HRESULT GetParent( - [in] REFIID riid, - [out] void **parent - ); -} - -[ - object, - local, - uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6) -] -interface IDXGIDeviceSubObject : IDXGIObject -{ - HRESULT GetDevice( - [in] REFIID riid, - [out] void **device - ); -} - -[ - object, - uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b), - local, - pointer_default(unique) -] -interface IDXGIResource : IDXGIDeviceSubObject -{ - HRESULT GetSharedHandle([out] HANDLE *pSharedHandle); - HRESULT GetUsage([out] DXGI_USAGE *pUsage); - HRESULT SetEvictionPriority([in] UINT EvictionPriority); - HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority); -} - -[ - object, - uuid(9d8e1289-d7b3-465f-8126-250e349af85d), - local, - pointer_default(unique) -] -interface IDXGIKeyedMutex : IDXGIDeviceSubObject -{ - HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds); - HRESULT ReleaseSync([in] UINT64 Key); -} - -[ - object, - local, - uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec) -] -interface IDXGISurface : IDXGIDeviceSubObject -{ - HRESULT GetDesc( - [out] DXGI_SURFACE_DESC *desc - ); - HRESULT Map( - [out] DXGI_MAPPED_RECT *mapped_rect, - [in] UINT flags - ); - HRESULT Unmap( - ); -} - -[ - object, - local, - uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86) -] -interface IDXGISurface1 : IDXGISurface -{ - HRESULT GetDC( - [in] BOOL discard, - [out] HDC *hdc - ); - HRESULT ReleaseDC( - [in] RECT *dirty_rect - ); -} - -[ - object, - local, - uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa) -] -interface IDXGIOutput : IDXGIObject -{ - HRESULT GetDesc( - [out] DXGI_OUTPUT_DESC *desc - ); - HRESULT GetDisplayModeList( - [in] DXGI_FORMAT format, - [in] UINT flags, - [in, out] UINT *mode_count, - [out] DXGI_MODE_DESC *desc - ); - HRESULT FindClosestMatchingMode( - [in] const DXGI_MODE_DESC *mode, - [out] DXGI_MODE_DESC *closest_match, - [in] IUnknown *device - ); - HRESULT WaitForVBlank( - ); - HRESULT TakeOwnership( - [in] IUnknown *device, - [in] BOOL exclusive - ); - void ReleaseOwnership( - ); - HRESULT GetGammaControlCapabilities( - [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps - ); - HRESULT SetGammaControl( - [in] const DXGI_GAMMA_CONTROL *gamma_control - ); - HRESULT GetGammaControl( - [out] DXGI_GAMMA_CONTROL *gamma_control - ); - HRESULT SetDisplaySurface( - [in] IDXGISurface *surface - ); - HRESULT GetDisplaySurfaceData( - [in] IDXGISurface *surface - ); - HRESULT GetFrameStatistics( - [out] DXGI_FRAME_STATISTICS *stats - ); -} - -[ - object, - local, - uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0) -] -interface IDXGIAdapter : IDXGIObject -{ - HRESULT EnumOutputs( - [in] UINT output_idx, - [in, out] IDXGIOutput **output - ); - HRESULT GetDesc( - [out] DXGI_ADAPTER_DESC *desc - ); - HRESULT CheckInterfaceSupport( - [in] REFGUID guid, - [out] LARGE_INTEGER *umd_version - ); -} - -cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)") - -cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)") -cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)") -cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)") -cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)") -cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)") -cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)") -cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)") -cpp_quote("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)") -cpp_quote("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)") - -[ - object, - local, - uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a) -] -interface IDXGISwapChain : IDXGIDeviceSubObject -{ - HRESULT Present( - [in] UINT sync_interval, - [in] UINT flags - ); - HRESULT GetBuffer( - [in] UINT buffer_idx, - [in] REFIID riid, - [in, out] void **surface - ); - HRESULT SetFullscreenState( - [in] BOOL fullscreen, - [in] IDXGIOutput *target - ); - HRESULT GetFullscreenState( - [out] BOOL *fullscreen, - [out] IDXGIOutput **target - ); - HRESULT GetDesc( - [out] DXGI_SWAP_CHAIN_DESC *desc - ); - HRESULT ResizeBuffers( - [in] UINT buffer_count, - [in] UINT width, - [in] UINT height, - [in] DXGI_FORMAT format, - [in] UINT flags - ); - HRESULT ResizeTarget( - [in] const DXGI_MODE_DESC *target_mode_desc - ); - HRESULT GetContainingOutput( - [out] IDXGIOutput **output - ); - HRESULT GetFrameStatistics( - [out] DXGI_FRAME_STATISTICS *stats - ); - HRESULT GetLastPresentCount( - [out] UINT *last_present_count - ); -} - -cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1") -cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2") -cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4") -cpp_quote("#define DXGI_MWA_VALID 0x7") - -[ - object, - local, - uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369) -] -interface IDXGIFactory : IDXGIObject -{ - HRESULT EnumAdapters( - [in] UINT adapter_idx, - [out] IDXGIAdapter **adapter - ); - HRESULT MakeWindowAssociation( - [in] HWND window, - [in] UINT flags - ); - HRESULT GetWindowAssociation( - [in] HWND *window - ); - HRESULT CreateSwapChain( - [in] IUnknown *device, - [in] DXGI_SWAP_CHAIN_DESC *desc, - [out] IDXGISwapChain **swapchain - ); - HRESULT CreateSoftwareAdapter( - [in] HMODULE swrast, - [out] IDXGIAdapter **adapter - ); -} - -[local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory); -[local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory); - -[ - object, - local, - uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c) -] -interface IDXGIDevice : IDXGIObject -{ - HRESULT GetAdapter( - [out] IDXGIAdapter **adapter - ); - HRESULT CreateSurface( - [in] const DXGI_SURFACE_DESC *desc, - [in] UINT surface_count, - [in] DXGI_USAGE usage, - [in] const DXGI_SHARED_RESOURCE *shared_resource, - [out] IDXGISurface **surface - ); - HRESULT QueryResourceResidency( - [in] IUnknown *const *resources, - [out] DXGI_RESIDENCY *residency, - [in] UINT resource_count - ); - HRESULT SetGPUThreadPriority( - [in] INT priority - ); - HRESULT GetGPUThreadPriority( - [out] INT *priority - ); -} - -typedef enum DXGI_ADAPTER_FLAG { - DXGI_ADAPTER_FLAG_NONE = 0, - DXGI_ADAPTER_FLAG_REMOTE = 1, - DXGI_ADAPTER_FLAG_SOFTWARE = 2, - DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF -} DXGI_ADAPTER_FLAG; - -typedef struct DXGI_ADAPTER_DESC1 { - WCHAR Description[128]; - UINT VendorId; - UINT DeviceId; - UINT SubSysId; - UINT Revision; - SIZE_T DedicatedVideoMemory; - SIZE_T DedicatedSystemMemory; - SIZE_T SharedSystemMemory; - LUID AdapterLuid; - UINT Flags; -} DXGI_ADAPTER_DESC1; - -typedef struct DXGI_DISPLAY_COLOR_SPACE { - FLOAT PrimaryCoordinates[8][2]; - FLOAT WhitePoints[16][2]; -} DXGI_DISPLAY_COLOR_SPACE; - -[ - object, - uuid(29038f61-3839-4626-91fd-086879011a05), - local, - pointer_default(unique) -] -interface IDXGIAdapter1 : IDXGIAdapter -{ - HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc); -} - -[ - object, - uuid(77db970f-6276-48ba-ba28-070143b4392c), - local, - pointer_default(unique) -] -interface IDXGIDevice1 : IDXGIDevice -{ - HRESULT SetMaximumFrameLatency([in] UINT MaxLatency); - HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency); -} - -[ - object, - uuid(770aae78-f26f-4dba-a829-253c83d1b387), - local, - pointer_default(unique) - ] -interface IDXGIFactory1 : IDXGIFactory -{ - HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter); - BOOL IsCurrent(); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/dxgicommon.idl b/wrappers/to-synch/sdk/include/reactos/wine/dxgicommon.idl deleted file mode 100644 index 99ace03c37d..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/dxgicommon.idl +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2017 Ihsan Akmal - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -cpp_quote("#if 0") -typedef unsigned int UINT; -cpp_quote("#endif") - -const UINT DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN = 0xffffffff; -const UINT DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN = 0xfffffffe; - -typedef enum DXGI_COLOR_SPACE_TYPE -{ - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0x00, - DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 0x01, - DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 0x02, - DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 0x03, - DXGI_COLOR_SPACE_RESERVED = 0x04, - DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 0x05, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 0x06, - DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 0x07, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 0x08, - DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 0x09, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 0x0a, - DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 0x0b, - DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 0x0c, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 0x0d, - DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 0x0e, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 0x0f, - DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 0x10, - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 0x11, - DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 0x12, - DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 0x13, - DXGI_COLOR_SPACE_CUSTOM = 0xffffffff, -} DXGI_COLOR_SPACE_TYPE; - -typedef struct DXGI_SAMPLE_DESC -{ - UINT Count; - UINT Quality; -} DXGI_SAMPLE_DESC; - -typedef struct DXGI_RATIONAL -{ - UINT Numerator; - UINT Denominator; -} DXGI_RATIONAL; diff --git a/wrappers/to-synch/sdk/include/reactos/wine/dxgiformat.idl b/wrappers/to-synch/sdk/include/reactos/wine/dxgiformat.idl deleted file mode 100644 index 5f85064d0dd..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/dxgiformat.idl +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2016 Józef Kucia for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -const unsigned int DXGI_FORMAT_DEFINED = 1; - -typedef enum DXGI_FORMAT -{ - DXGI_FORMAT_UNKNOWN = 0x00, - DXGI_FORMAT_R32G32B32A32_TYPELESS = 0x01, - DXGI_FORMAT_R32G32B32A32_FLOAT = 0x02, - DXGI_FORMAT_R32G32B32A32_UINT = 0x03, - DXGI_FORMAT_R32G32B32A32_SINT = 0x04, - DXGI_FORMAT_R32G32B32_TYPELESS = 0x05, - DXGI_FORMAT_R32G32B32_FLOAT = 0x06, - DXGI_FORMAT_R32G32B32_UINT = 0x07, - DXGI_FORMAT_R32G32B32_SINT = 0x08, - DXGI_FORMAT_R16G16B16A16_TYPELESS = 0x09, - DXGI_FORMAT_R16G16B16A16_FLOAT = 0x0a, - DXGI_FORMAT_R16G16B16A16_UNORM = 0x0b, - DXGI_FORMAT_R16G16B16A16_UINT = 0x0c, - DXGI_FORMAT_R16G16B16A16_SNORM = 0x0d, - DXGI_FORMAT_R16G16B16A16_SINT = 0x0e, - DXGI_FORMAT_R32G32_TYPELESS = 0x0f, - DXGI_FORMAT_R32G32_FLOAT = 0x10, - DXGI_FORMAT_R32G32_UINT = 0x11, - DXGI_FORMAT_R32G32_SINT = 0x12, - DXGI_FORMAT_R32G8X24_TYPELESS = 0x13, - DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 0x14, - DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 0x15, - DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 0x16, - DXGI_FORMAT_R10G10B10A2_TYPELESS = 0x17, - DXGI_FORMAT_R10G10B10A2_UNORM = 0x18, - DXGI_FORMAT_R10G10B10A2_UINT = 0x19, - DXGI_FORMAT_R11G11B10_FLOAT = 0x1a, - DXGI_FORMAT_R8G8B8A8_TYPELESS = 0x1b, - DXGI_FORMAT_R8G8B8A8_UNORM = 0x1c, - DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 0x1d, - DXGI_FORMAT_R8G8B8A8_UINT = 0x1e, - DXGI_FORMAT_R8G8B8A8_SNORM = 0x1f, - DXGI_FORMAT_R8G8B8A8_SINT = 0x20, - DXGI_FORMAT_R16G16_TYPELESS = 0x21, - DXGI_FORMAT_R16G16_FLOAT = 0x22, - DXGI_FORMAT_R16G16_UNORM = 0x23, - DXGI_FORMAT_R16G16_UINT = 0x24, - DXGI_FORMAT_R16G16_SNORM = 0x25, - DXGI_FORMAT_R16G16_SINT = 0x26, - DXGI_FORMAT_R32_TYPELESS = 0x27, - DXGI_FORMAT_D32_FLOAT = 0x28, - DXGI_FORMAT_R32_FLOAT = 0x29, - DXGI_FORMAT_R32_UINT = 0x2a, - DXGI_FORMAT_R32_SINT = 0x2b, - DXGI_FORMAT_R24G8_TYPELESS = 0x2c, - DXGI_FORMAT_D24_UNORM_S8_UINT = 0x2d, - DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 0x2e, - DXGI_FORMAT_X24_TYPELESS_G8_UINT = 0x2f, - DXGI_FORMAT_R8G8_TYPELESS = 0x30, - DXGI_FORMAT_R8G8_UNORM = 0x31, - DXGI_FORMAT_R8G8_UINT = 0x32, - DXGI_FORMAT_R8G8_SNORM = 0x33, - DXGI_FORMAT_R8G8_SINT = 0x34, - DXGI_FORMAT_R16_TYPELESS = 0x35, - DXGI_FORMAT_R16_FLOAT = 0x36, - DXGI_FORMAT_D16_UNORM = 0x37, - DXGI_FORMAT_R16_UNORM = 0x38, - DXGI_FORMAT_R16_UINT = 0x39, - DXGI_FORMAT_R16_SNORM = 0x3a, - DXGI_FORMAT_R16_SINT = 0x3b, - DXGI_FORMAT_R8_TYPELESS = 0x3c, - DXGI_FORMAT_R8_UNORM = 0x3d, - DXGI_FORMAT_R8_UINT = 0x3e, - DXGI_FORMAT_R8_SNORM = 0x3f, - DXGI_FORMAT_R8_SINT = 0x40, - DXGI_FORMAT_A8_UNORM = 0x41, - DXGI_FORMAT_R1_UNORM = 0x42, - DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 0x43, - DXGI_FORMAT_R8G8_B8G8_UNORM = 0x44, - DXGI_FORMAT_G8R8_G8B8_UNORM = 0x45, - DXGI_FORMAT_BC1_TYPELESS = 0x46, - DXGI_FORMAT_BC1_UNORM = 0x47, - DXGI_FORMAT_BC1_UNORM_SRGB = 0x48, - DXGI_FORMAT_BC2_TYPELESS = 0x49, - DXGI_FORMAT_BC2_UNORM = 0x4a, - DXGI_FORMAT_BC2_UNORM_SRGB = 0x4b, - DXGI_FORMAT_BC3_TYPELESS = 0x4c, - DXGI_FORMAT_BC3_UNORM = 0x4d, - DXGI_FORMAT_BC3_UNORM_SRGB = 0x4e, - DXGI_FORMAT_BC4_TYPELESS = 0x4f, - DXGI_FORMAT_BC4_UNORM = 0x50, - DXGI_FORMAT_BC4_SNORM = 0x51, - DXGI_FORMAT_BC5_TYPELESS = 0x52, - DXGI_FORMAT_BC5_UNORM = 0x53, - DXGI_FORMAT_BC5_SNORM = 0x54, - DXGI_FORMAT_B5G6R5_UNORM = 0x55, - DXGI_FORMAT_B5G5R5A1_UNORM = 0x56, - DXGI_FORMAT_B8G8R8A8_UNORM = 0x57, - DXGI_FORMAT_B8G8R8X8_UNORM = 0x58, - DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 0x59, - DXGI_FORMAT_B8G8R8A8_TYPELESS = 0x5a, - DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 0x5b, - DXGI_FORMAT_B8G8R8X8_TYPELESS = 0x5c, - DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 0x5d, - DXGI_FORMAT_BC6H_TYPELESS = 0x5e, - DXGI_FORMAT_BC6H_UF16 = 0x5f, - DXGI_FORMAT_BC6H_SF16 = 0x60, - DXGI_FORMAT_BC7_TYPELESS = 0x61, - DXGI_FORMAT_BC7_UNORM = 0x62, - DXGI_FORMAT_BC7_UNORM_SRGB = 0x63, - DXGI_FORMAT_AYUV = 0x64, - DXGI_FORMAT_Y410 = 0x65, - DXGI_FORMAT_Y416 = 0x66, - DXGI_FORMAT_NV12 = 0x67, - DXGI_FORMAT_P010 = 0x68, - DXGI_FORMAT_P016 = 0x69, - DXGI_FORMAT_420_OPAQUE = 0x6a, - DXGI_FORMAT_YUY2 = 0x6b, - DXGI_FORMAT_Y210 = 0x6c, - DXGI_FORMAT_Y216 = 0x6d, - DXGI_FORMAT_NV11 = 0x6e, - DXGI_FORMAT_AI44 = 0x6f, - DXGI_FORMAT_IA44 = 0x70, - DXGI_FORMAT_P8 = 0x71, - DXGI_FORMAT_A8P8 = 0x72, - DXGI_FORMAT_B4G4R4A4_UNORM = 0x73, - - DXGI_FORMAT_P208 = 0x82, - DXGI_FORMAT_V208 = 0x83, - DXGI_FORMAT_V408 = 0x84, - - DXGI_FORMAT_FORCE_UINT = 0xffffffff, -} DXGI_FORMAT; diff --git a/wrappers/to-synch/sdk/include/reactos/wine/dxgitype.idl b/wrappers/to-synch/sdk/include/reactos/wine/dxgitype.idl deleted file mode 100644 index a9ed5719a5f..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/dxgitype.idl +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2007 Andras Kovacs - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "dxgicommon.idl"; -import "dxgiformat.idl"; - -cpp_quote("#if 0") -typedef unsigned int UINT; -typedef long BOOL; -cpp_quote("#endif") - -typedef enum DXGI_MODE_ROTATION -{ - DXGI_MODE_ROTATION_UNSPECIFIED = 0x0, - DXGI_MODE_ROTATION_IDENTITY = 0x1, - DXGI_MODE_ROTATION_ROTATE90 = 0x2, - DXGI_MODE_ROTATION_ROTATE180 = 0x3, - DXGI_MODE_ROTATION_ROTATE270 = 0x4, -} DXGI_MODE_ROTATION; - -typedef enum DXGI_MODE_SCANLINE_ORDER -{ - DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0x0, - DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 0x1, - DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 0x2, - DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 0x3, -} DXGI_MODE_SCANLINE_ORDER; - -typedef enum DXGI_MODE_SCALING -{ - DXGI_MODE_SCALING_UNSPECIFIED = 0x0, - DXGI_MODE_SCALING_CENTERED = 0x1, - DXGI_MODE_SCALING_STRETCHED = 0x2, -} DXGI_MODE_SCALING; - -cpp_quote("#ifndef D3DCOLORVALUE_DEFINED") -cpp_quote("#define D3DCOLORVALUE_DEFINED") -typedef struct _D3DCOLORVALUE -{ - float r; - float g; - float b; - float a; -} D3DCOLORVALUE; -cpp_quote("#endif") -typedef D3DCOLORVALUE DXGI_RGBA; - -typedef struct DXGI_MODE_DESC -{ - UINT Width; - UINT Height; - DXGI_RATIONAL RefreshRate; - DXGI_FORMAT Format; - DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; - DXGI_MODE_SCALING Scaling; -} DXGI_MODE_DESC; - -typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES -{ - BOOL ScaleAndOffsetSupported; - float MaxConvertedValue; - float MinConvertedValue; - UINT NumGammaControlPoints; - float ControlPointPositions[1025]; -} DXGI_GAMMA_CONTROL_CAPABILITIES; - -typedef struct DXGI_RGB -{ - float Red; - float Green; - float Blue; -} DXGI_RGB; - -typedef struct DXGI_GAMMA_CONTROL -{ - DXGI_RGB Scale; - DXGI_RGB Offset; - DXGI_RGB GammaCurve[1025]; -} DXGI_GAMMA_CONTROL; diff --git a/wrappers/to-synch/sdk/include/reactos/wine/evr.idl b/wrappers/to-synch/sdk/include/reactos/wine/evr.idl deleted file mode 100644 index 413f5af1d47..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/evr.idl +++ /dev/null @@ -1,327 +0,0 @@ -/* - * COM Classes for evr - * - * Copyright 2017 Fabian Maurer - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "unknwn.idl"; -import "propidl.idl"; -import "mfidl.idl"; -import "mftransform.idl"; -import "mediaobj.idl"; -import "strmif.idl"; - -cpp_quote("#ifndef _MFVideoNormalizedRect_") -cpp_quote("#define _MFVideoNormalizedRect_") -typedef struct MFVideoNormalizedRect -{ - float left; - float top; - float right; - float bottom; -} MFVideoNormalizedRect; -cpp_quote("#endif") - -typedef enum _MFVP_MESSAGE_TYPE { - MFVP_MESSAGE_FLUSH, - MFVP_MESSAGE_INVALIDATEMEDIATYPE, - MFVP_MESSAGE_PROCESSINPUTNOTIFY, - MFVP_MESSAGE_BEGINSTREAMING, - MFVP_MESSAGE_ENDSTREAMING, - MFVP_MESSAGE_ENDOFSTREAM, - MFVP_MESSAGE_STEP, - MFVP_MESSAGE_CANCELSTEP, -} MFVP_MESSAGE_TYPE; - -[ - object, - uuid(29aff080-182a-4a5d-af3b-448f3a6346cb), - local -] -interface IMFVideoPresenter : IMFClockStateSink -{ - HRESULT ProcessMessage( - [in] MFVP_MESSAGE_TYPE eMessage, - [in] ULONG_PTR ulParam - ); - HRESULT GetCurrentMediaType( - [out] IMFVideoMediaType **ppMediaType - ); -} - -[ - object, - uuid(83e91e85-82c1-4ea7-801d-85dc50b75086), - local -] -interface IEVRFilterConfig : IUnknown -{ - HRESULT SetNumberOfStreams( - [in] DWORD dwMaxStreams - ); - HRESULT GetNumberOfStreams( - [out] DWORD *pdwMaxStreams - ); -} - -[ - object, - uuid(1f6a9f17-e70b-4e24-8ae4-0b2c3ba7a4ae), - local -] -interface IMFVideoPositionMapper : IUnknown -{ - HRESULT MapOutputCoordinateToInputStream( - [in] float xOut, - [in] float yOut, - [in] DWORD dwOutputStreamIndex, - [in] DWORD dwInputStreamIndex, - [out] float *pxIn, - [out] float *pyIn - ); -} - -[ - object, - uuid(dfdfd197-a9ca-43d8-b341-6af3503792cd), - local -] -interface IMFVideoRenderer : IUnknown -{ - HRESULT InitializeRenderer( - [in] IMFTransform *pVideoMixer, - [in] IMFVideoPresenter *pVideoPresenter - ); -} - -typedef enum _MF_SERVICE_LOOKUP_TYPE -{ - MF_SERVICE_LOOKUP_UPSTREAM, - MF_SERVICE_LOOKUP_UPSTREAM_DIRECT, - MF_SERVICE_LOOKUP_DOWNSTREAM, - MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT, - MF_SERVICE_LOOKUP_ALL, - MF_SERVICE_LOOKUP_GLOBAL, -} MF_SERVICE_LOOKUP_TYPE; - -[ - object, - uuid(fa993889-4383-415a-a930-dd472a8cf6f7), - local -] -interface IMFTopologyServiceLookup : IUnknown -{ - HRESULT LookupService( - [in] MF_SERVICE_LOOKUP_TYPE lookup_type, - [in] DWORD index, - [in] REFGUID service, - [in] REFIID riid, - [out, iid_is(riid)] void **objects, - [in, out] DWORD *num_objects - ); -} - -[ - object, - uuid(fa99388a-4383-415a-a930-dd472a8cf6f7), - local -] -interface IMFTopologyServiceLookupClient : IUnknown -{ - HRESULT InitServicePointers( - [in] IMFTopologyServiceLookup *service_lookup - ); - HRESULT ReleaseServicePointers(); -} - -[ - object, - uuid(a38d9567-5a9c-4f3c-b293-8eb415b279ba), - local -] -interface IMFVideoDeviceID : IUnknown -{ - HRESULT GetDeviceID( - [out] IID *device_id - ); -} - -[ - object, - uuid(a5c6c53f-c202-4aa5-9695-175ba8c508a5) -] -interface IMFVideoMixerControl : IUnknown -{ - HRESULT SetStreamZOrder( - [in] DWORD stream_id, - [in] DWORD zorder - ); - HRESULT GetStreamZOrder( - [in] DWORD stream_id, - [out] DWORD *zorder - ); - HRESULT SetStreamOutputRect( - [in] DWORD stream_id, - [in] const MFVideoNormalizedRect *rect - ); - HRESULT GetStreamOutputRect( - [in] DWORD stream_id, - [out] MFVideoNormalizedRect *rect - ); -} - -typedef enum _MFVideoMixPrefs -{ - MFVideoMixPrefs_ForceHalfInterlace = 0x00000001, - MFVideoMixPrefs_AllowDropToHalfInterlace = 0x00000002, - MFVideoMixPrefs_AllowDropToBob = 0x00000004, - MFVideoMixPrefs_ForceBob = 0x00000008, - MFVideoMixPrefs_EnableRotation = 0x00000010, - MFVideoMixPrefs_Mask = 0x0000001f, -} MFVideoMixPrefs; - -[ - object, - uuid(8459616d-966e-4930-b658-54fa7e5a16d3) -] -interface IMFVideoMixerControl2 : IMFVideoMixerControl -{ - HRESULT SetMixingPrefs( - [in] DWORD flags - ); - HRESULT GetMixingPrefs( - [out] DWORD *flags - ); -} - -[ - object, - uuid(56c294d0-753e-4260-8d61-a3d8820b1d54), - local -] -interface IMFDesiredSample : IUnknown -{ - HRESULT GetDesiredSampleTimeAndDuration( - [out] LONGLONG *sample_time, - [out] LONGLONG *sample_duration - ); - - void SetDesiredSampleTimeAndDuration( - [in] LONGLONG sample_time, - [in] LONGLONG sample_duration - ); - - void Clear(); -} - -typedef enum MFVideoAspectRatioMode -{ - MFVideoARMode_None = 0x00000000, - MFVideoARMode_PreservePicture = 0x00000001, - MFVideoARMode_PreservePixel = 0x00000002, - MFVideoARMode_NonLinearStretch = 0x00000004, - MFVideoARMode_Mask = 0x00000007, -} MFVideoAspectRatioMode; - -[ - object, - uuid(a490b1e4-ab84-4d31-a1b2-181e03b1077a), -] -interface IMFVideoDisplayControl : IUnknown -{ - HRESULT GetNativeVideoSize( - [in, out, unique] SIZE *video_size, - [in, out, unique] SIZE *aspect_ratio - ); - - HRESULT GetIdealVideoSize( - [in, out, unique] SIZE *min_size, - [in, out, unique] SIZE *max_size - ); - - HRESULT SetVideoPosition( - [in, unique] const MFVideoNormalizedRect *source, - [in, unique] const RECT *dest - ); - - HRESULT GetVideoPosition( - [out] MFVideoNormalizedRect *source, - [out] RECT *dest - ); - - HRESULT SetAspectRatioMode( - [in] DWORD mode - ); - - HRESULT GetAspectRatioMode( - [out] DWORD *mode - ); - - HRESULT SetVideoWindow( - [in] HWND window - ); - - HRESULT GetVideoWindow( - [out] HWND *window - ); - - HRESULT RepaintVideo(); - - HRESULT GetCurrentImage( - [in, out] LPBITMAPINFOHEADER header, - [out, size_is(, *dib_size)] BYTE **dib, - [out] DWORD *dib_size, - [in, out, unique] LONGLONG *timestamp - ); - - HRESULT SetBorderColor( - [in] COLORREF color - ); - - HRESULT GetBorderColor( - [out] COLORREF *color - ); - - HRESULT SetRenderingPrefs( - [in] DWORD flags - ); - - HRESULT GetRenderingPrefs( - [out] DWORD *flags - ); - - HRESULT SetFullscreen( - [in] BOOL fullscreen - ); - - HRESULT GetFullscreen( - [out] BOOL *fullscreen - ); -} - -cpp_quote("DEFINE_GUID(MR_VIDEO_RENDER_SERVICE, 0x1092a86c, 0xab1a, 0x459a, 0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff);") -cpp_quote("DEFINE_GUID(MR_VIDEO_MIXER_SERVICE, 0x073cd2fc, 0x6cf4, 0x40b7, 0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8);") -cpp_quote("DEFINE_GUID(MR_VIDEO_ACCELERATION_SERVICE, 0xefef5175, 0x5c7d, 0x4ce2, 0xbb, 0xbd, 0x34, 0xff, 0x8b, 0xca, 0x65, 0x54);") -cpp_quote("DEFINE_GUID(MR_BUFFER_SERVICE, 0xa562248c, 0x9ac6, 0x4ffc, 0x9f, 0xba, 0x3a, 0xf8, 0xf8, 0xad, 0x1a, 0x4d);") -cpp_quote("DEFINE_GUID(VIDEO_ZOOM_RECT, 0x7aaa1638, 0x1b7f, 0x4c93, 0xbd, 0x89, 0x5b, 0x9c, 0x9f, 0xb6, 0xfc, 0xf0);") -cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") -cpp_quote("HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *presenter_outer, ") -cpp_quote(" REFIID riid_mixer, void **mixer, REFIID riid_presenter, void **presenter);") -cpp_quote("HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") -cpp_quote("HRESULT WINAPI MFCreateVideoRenderer(REFIID riid, void **renderer);") -cpp_quote("HRESULT WINAPI MFCreateVideoSampleAllocator(REFIID riid, void **allocator);") -cpp_quote("HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sample);") diff --git a/wrappers/to-synch/sdk/include/reactos/wine/irpcss.idl b/wrappers/to-synch/sdk/include/reactos/wine/irpcss.idl deleted file mode 100644 index 5d27658eba5..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/irpcss.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 Nikolay Sivov for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "wtypes.idl"; -#include "wine/orpc.idl" - -cpp_quote("#define IRPCSS_PROTSEQ {'n','c','a','l','r','p','c',0}") -cpp_quote("#define IRPCSS_ENDPOINT {'i','r','p','c','s','s',0}") - -[ - uuid(85da4974-edc7-40ff-bad4-9c4525a8d044), - version(0.0), -] -interface Irpcss -{ - HRESULT irpcss_server_register( - [in] handle_t handle, - [in] const GUID *clsid, - [in] unsigned int flags, - [in] PMInterfacePointer object, - [out] unsigned int *cookie); - - HRESULT irpcss_server_revoke( - [in] handle_t handle, - [in] unsigned int cookie); - - HRESULT irpcss_get_class_object( - [in] handle_t handle, - [in] const GUID *clsid, - [out] PMInterfacePointer *object); - - HRESULT irpcss_get_thread_seq_id( - [in] handle_t handle, - [out] DWORD *sequence_id); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/mfmediaengine.idl b/wrappers/to-synch/sdk/include/reactos/wine/mfmediaengine.idl deleted file mode 100644 index c00e364116e..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/mfmediaengine.idl +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright 2019 Jactry Zeng for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "mfidl.idl"; - -cpp_quote("EXTERN_GUID(CLSID_MFMediaEngineClassFactory, 0xb44392da, 0x499b, 0x446b, 0xa4, 0xcb, 0x00, 0x5f, 0xea, 0xd0, 0xe6, 0xd5);") - -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_AUDIO_CATEGORY, 0xc8d4c51d, 0x350e, 0x41f2, 0xba, 0x46, 0xfa, 0xeb, 0xbb, 0x08, 0x57, 0xf6);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE, 0xd2cb93d1, 0x116a, 0x44f2, 0x93, 0x85, 0xf7, 0xd0, 0xfd, 0xa2, 0xfb, 0x46);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE, 0x4e0212e2, 0xe18f, 0x41e1, 0x95, 0xe5, 0xc0, 0xe7, 0xe9, 0x23, 0x5b, 0xc3);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE_IE9, 0x052c2d39, 0x40c0, 0x4188, 0xab, 0x86, 0xf8, 0x28, 0x27, 0x3b, 0x75, 0x22);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE_IE10, 0x11a47afd, 0x6589, 0x4124, 0xb3, 0x12, 0x61, 0x58, 0xec, 0x51, 0x7f, 0xc3);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE_IE11, 0x1cf1315f, 0xce3f, 0x4035, 0x93, 0x91, 0x16, 0x14, 0x2f, 0x77, 0x51, 0x89);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE_IE_EDGE, 0xa6f3e465, 0x3aca, 0x442c, 0xa3, 0xf0, 0xad, 0x6d, 0xda, 0xd8, 0x39, 0xae);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_CALLBACK, 0xc60381b8, 0x83a4, 0x41f8, 0xa3, 0xd0, 0xde, 0x05, 0x07, 0x68, 0x49, 0xa9);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_COMPATIBILITY_MODE, 0x3ef26ad4, 0xdc54, 0x45de, 0xb9, 0xaf, 0x76, 0xc8, 0xc6, 0x6b, 0xfa, 0x8e);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_COMPATIBILITY_MODE_WIN10, 0x5b25e089, 0x6ca7, 0x4139, 0xa2, 0xcb, 0xfc, 0xaa, 0xb3, 0x95, 0x52, 0xa3);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_COMPATIBILITY_MODE_WWA_EDGE, 0x15b29098, 0x9f01, 0x4e4d, 0xb6, 0x5a, 0xc0, 0x6c, 0x6c, 0x89, 0xda, 0x2a);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_CONTENT_PROTECTION_FLAGS, 0xe0350223, 0x5aaf, 0x4d76, 0xa7, 0xc3, 0x06, 0xde, 0x70, 0x89, 0x4d, 0xb4);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_CONTENT_PROTECTION_MANAGER, 0xfdd6dfaa, 0xbd85, 0x4af3, 0x9e, 0x0f, 0xa0, 0x1d, 0x53, 0x9d, 0x87, 0x6a);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_CONTINUE_ON_CODEC_ERROR, 0xdbcdb7f9, 0x48e4, 0x4295, 0xb7, 0x0d, 0xd5, 0x18, 0x23, 0x4e, 0xeb, 0x38);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_COREWINDOW, 0xfccae4dc, 0x0b7f, 0x41c2, 0x9f, 0x96, 0x46, 0x59, 0x94, 0x8a, 0xcd, 0xdc);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_DXGI_MANAGER, 0x065702da, 0x1094, 0x486d, 0x86, 0x17, 0xee, 0x7c, 0xc4, 0xee, 0x46, 0x48);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_EME_CALLBACK, 0x494553a7, 0xa481, 0x4cb7, 0xbe, 0xc5, 0x38, 0x09, 0x03, 0x51, 0x37, 0x31);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_EXTENSION, 0x3109fd46, 0x060d, 0x4b62, 0x8d, 0xcf, 0xfa, 0xff, 0x81, 0x13, 0x18, 0xd2);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_MEDIA_PLAYER_MODE, 0x3ddd8d45, 0x5aa1, 0x4112, 0x82, 0xe5, 0x36, 0xf6, 0xa2, 0x19, 0x7e, 0x6e);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_NEEDKEY_CALLBACK, 0x7ea80843, 0xb6e4, 0x432c, 0x8e, 0xa4, 0x78, 0x48, 0xff, 0xe4, 0x22, 0x0e);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_OPM_HWND, 0xa0be8ee7, 0x0572, 0x4f2c, 0xa8, 0x01, 0x2a, 0x15, 0x1b, 0xd3, 0xe7, 0x26);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_PLAYBACK_HWND, 0xd988879b, 0x67c9, 0x4d92, 0xba, 0xa7, 0x6e, 0xad, 0xd4, 0x46, 0x03, 0x9d);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_PLAYBACK_VISUAL, 0x6debd26f, 0x6ab9, 0x4d7e, 0xb0, 0xee, 0xc6, 0x1a, 0x73, 0xff, 0xad, 0x15);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_SOURCE_RESOLVER_CONFIG_STORE, 0x0ac0c497, 0xb3c4, 0x48c9, 0x9c, 0xde, 0xbb, 0x8c, 0xa2, 0x44, 0x2c, 0xa3);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_STREAM_CONTAINS_ALPHA_CHANNEL, 0x5cbfaf44, 0xd2b2, 0x4cfb, 0x80, 0xa7, 0xd4, 0x29, 0xc7, 0x4c, 0x78, 0x9d);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_SYNCHRONOUS_CLOSE, 0xc3c2e12f, 0x7e0e, 0x4e43, 0xb9, 0x1c, 0xdc, 0x99, 0x2c, 0xcd, 0xfa, 0x5e);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_TELEMETRY_APPLICATION_ID, 0x1e7b273b, 0xa7e4, 0x402a, 0x8f, 0x51, 0xc4, 0x8e, 0x88, 0xa2, 0xca, 0xbc);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_TRACK_ID, 0x65bea312, 0x4043, 0x4815, 0x8e, 0xab, 0x44, 0xdc, 0xe2, 0xef, 0x8f, 0x2a);") -cpp_quote("EXTERN_GUID(MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT, 0x5066893c, 0x8cf9, 0x42bc, 0x8b, 0x8a, 0x47, 0x22, 0x12, 0xe5, 0x27, 0x26);") - -typedef enum MF_MEDIA_ENGINE_ERR -{ - MF_MEDIA_ENGINE_ERR_NOERROR, - MF_MEDIA_ENGINE_ERR_ABORTED, - MF_MEDIA_ENGINE_ERR_NETWORK, - MF_MEDIA_ENGINE_ERR_DECODE, - MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED, - MF_MEDIA_ENGINE_ERR_ENCRYPTED -} MF_MEDIA_ENGINE_ERR; - -typedef enum MF_MEDIA_ENGINE_PRELOAD -{ - MF_MEDIA_ENGINE_PRELOAD_MISSING, - MF_MEDIA_ENGINE_PRELOAD_EMPTY, - MF_MEDIA_ENGINE_PRELOAD_NONE, - MF_MEDIA_ENGINE_PRELOAD_METADATA, - MF_MEDIA_ENGINE_PRELOAD_AUTOMATIC -} MF_MEDIA_ENGINE_PRELOAD; - -typedef enum MF_MEDIA_ENGINE_CANPLAY -{ - MF_MEDIA_ENGINE_CANPLAY_NOT_SUPPORTED, - MF_MEDIA_ENGINE_CANPLAY_MAYBE, - MF_MEDIA_ENGINE_CANPLAY_PROBABLY, -} MF_MEDIA_ENGINE_CANPLAY; - -cpp_quote("#ifndef _MFVideoNormalizedRect_") -cpp_quote("#define _MFVideoNormalizedRect_") -typedef struct MFVideoNormalizedRect -{ - float left; - float top; - float right; - float bottom; -} MFVideoNormalizedRect; -cpp_quote("#endif") - -typedef enum MF_MEDIA_ENGINE_CREATEFLAGS -{ - MF_MEDIA_ENGINE_AUDIOONLY = 0x1, - MF_MEDIA_ENGINE_WAITFORSTABLE_STATE = 0x2, - MF_MEDIA_ENGINE_FORCEMUTE = 0x4, - MF_MEDIA_ENGINE_REAL_TIME_MODE = 0x8, - MF_MEDIA_ENGINE_DISABLE_LOCAL_PLUGINS = 0x10, - MF_MEDIA_ENGINE_CREATEFLAGS_MASK = 0x1f -} MF_MEDIA_ENGINE_CREATEFLAGS; - -typedef enum MF_MEDIA_ENGINE_EVENT -{ - MF_MEDIA_ENGINE_EVENT_LOADSTART = 1, - MF_MEDIA_ENGINE_EVENT_PROGRESS = 2, - MF_MEDIA_ENGINE_EVENT_SUSPEND = 3, - MF_MEDIA_ENGINE_EVENT_ABORT = 4, - MF_MEDIA_ENGINE_EVENT_ERROR = 5, - MF_MEDIA_ENGINE_EVENT_EMPTIED = 6, - MF_MEDIA_ENGINE_EVENT_STALLED = 7, - MF_MEDIA_ENGINE_EVENT_PLAY = 8, - MF_MEDIA_ENGINE_EVENT_PAUSE = 9, - MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA = 10, - MF_MEDIA_ENGINE_EVENT_LOADEDDATA = 11, - MF_MEDIA_ENGINE_EVENT_WAITING = 12, - MF_MEDIA_ENGINE_EVENT_PLAYING = 13, - MF_MEDIA_ENGINE_EVENT_CANPLAY = 14, - MF_MEDIA_ENGINE_EVENT_CANPLAYTHROUGH = 15, - MF_MEDIA_ENGINE_EVENT_SEEKING = 16, - MF_MEDIA_ENGINE_EVENT_SEEKED = 17, - MF_MEDIA_ENGINE_EVENT_TIMEUPDATE = 18, - MF_MEDIA_ENGINE_EVENT_ENDED = 19, - MF_MEDIA_ENGINE_EVENT_RATECHANGE = 20, - MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE = 21, - MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE = 22, - MF_MEDIA_ENGINE_EVENT_FORMATCHANGE = 1000, - MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS = 1001, - MF_MEDIA_ENGINE_EVENT_TIMELINE_MARKER = 1002, - MF_MEDIA_ENGINE_EVENT_BALANCECHANGE = 1003, - MF_MEDIA_ENGINE_EVENT_DOWNLOADCOMPLETE = 1004, - MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED = 1005, - MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED = 1006, - MF_MEDIA_ENGINE_EVENT_FRAMESTEPCOMPLETED = 1007, - MF_MEDIA_ENGINE_EVENT_NOTIFYSTABLESTATE = 1008, - MF_MEDIA_ENGINE_EVENT_FIRSTFRAMEREADY = 1009, - MF_MEDIA_ENGINE_EVENT_TRACKSCHANGE = 1010, - MF_MEDIA_ENGINE_EVENT_OPMINFO = 1011, - MF_MEDIA_ENGINE_EVENT_RESOURCELOST = 1012, - MF_MEDIA_ENGINE_EVENT_DELAYLOADEVENT_CHANGED = 1013, - MF_MEDIA_ENGINE_EVENT_STREAMRENDERINGERROR = 1014, - MF_MEDIA_ENGINE_EVENT_SUPPORTEDRATES_CHANGED = 1015, - MF_MEDIA_ENGINE_EVENT_AUDIOENDPOINTCHANGE = 1016, -} MF_MEDIA_ENGINE_EVENT; - -typedef enum MF_MEDIA_ENGINE_READY -{ - MF_MEDIA_ENGINE_READY_HAVE_NOTHING, - MF_MEDIA_ENGINE_READY_HAVE_METADATA, - MF_MEDIA_ENGINE_READY_HAVE_CURRENT_DATA, - MF_MEDIA_ENGINE_READY_HAVE_FUTURE_DATA, - MF_MEDIA_ENGINE_READY_HAVE_ENOUGH_DATA, -} MF_MEDIA_ENGINE_READY; - -[ - object, - uuid(fc0e10d2-ab2a-4501-a951-06bb1075184c), - local, - pointer_default(unique) -] -interface IMFMediaError : IUnknown -{ - USHORT GetErrorCode(); - HRESULT GetExtendedErrorCode(); - HRESULT SetErrorCode([in] MF_MEDIA_ENGINE_ERR error); - HRESULT SetExtendedErrorCode([in] HRESULT error); -} - -[ - object, - uuid(7a5e5354-b114-4c72-b991-3131d75032ea), - local, - pointer_default(unique) -] -interface IMFMediaEngineSrcElements : IUnknown -{ - DWORD GetLength(); - HRESULT GetURL([in] DWORD index, [out] BSTR *url); - HRESULT GetType([in] DWORD index, [out] BSTR *type); - HRESULT GetMedia([in] DWORD index, [out] BSTR *media); - HRESULT AddElement([in] BSTR url, [in] BSTR type, [in] BSTR media); - HRESULT RemoveAllElements(); -} - -[ - object, - uuid(db71a2fc-078a-414e-9df9-8c2531b0aa6c), - local, - pointer_default(unique) -] -interface IMFMediaTimeRange : IUnknown -{ - DWORD GetLength(); - HRESULT GetStart([in] DWORD index, [out] double *start); - HRESULT GetEnd([in] DWORD index, [out] double *end); - BOOL ContainsTime([in] double time); - HRESULT AddRange([in] double start, [in] double end); - HRESULT Clear(); -} - -[ - object, - uuid(98a1b0bb-03eb-4935-ae7c-93c1fa0e1c93), - local, - pointer_default(unique) -] -interface IMFMediaEngine : IUnknown -{ - HRESULT GetError([out] IMFMediaError **error); - HRESULT SetErrorCode([in] MF_MEDIA_ENGINE_ERR error); - HRESULT SetSourceElements([in] IMFMediaEngineSrcElements *elements); - HRESULT SetSource([in] BSTR url); - HRESULT GetCurrentSource([out] BSTR *url); - USHORT GetNetworkState(); - MF_MEDIA_ENGINE_PRELOAD GetPreload(); - HRESULT SetPreload([in] MF_MEDIA_ENGINE_PRELOAD preload); - HRESULT GetBuffered([out] IMFMediaTimeRange **buffered); - HRESULT Load(); - HRESULT CanPlayType([in] BSTR type, [out] MF_MEDIA_ENGINE_CANPLAY *answer); - USHORT GetReadyState(); - BOOL IsSeeking(); - cpp_quote("#undef GetCurrentTime") - double GetCurrentTime(); - HRESULT SetCurrentTime([in] double time); - double GetStartTime(); - double GetDuration(); - BOOL IsPaused(); - double GetDefaultPlaybackRate(); - HRESULT SetDefaultPlaybackRate([in] double rate); - double GetPlaybackRate(); - HRESULT SetPlaybackRate([in] double rate); - HRESULT GetPlayed([out] IMFMediaTimeRange **played); - HRESULT GetSeekable([out] IMFMediaTimeRange **seekable); - BOOL IsEnded(); - BOOL GetAutoPlay(); - HRESULT SetAutoPlay([in] BOOL autoplay); - BOOL GetLoop(); - HRESULT SetLoop([in] BOOL loop); - HRESULT Play(); - HRESULT Pause(); - BOOL GetMuted(); - HRESULT SetMuted([in] BOOL muted); - double GetVolume(); - HRESULT SetVolume([in] double volume); - BOOL HasVideo(); - BOOL HasAudio(); - HRESULT GetNativeVideoSize([out] DWORD *cx, [out] DWORD *cy); - HRESULT GetVideoAspectRatio([out] DWORD *cx, [out] DWORD *cy); - HRESULT Shutdown(); - HRESULT TransferVideoFrame([in] IUnknown *surface, [in] const MFVideoNormalizedRect *src, - [in] const RECT *dst, [in] const MFARGB *color); - HRESULT OnVideoStreamTick([out] LONGLONG *time); -} - -typedef enum MF_MEDIA_ENGINE_STATISTIC -{ - MF_MEDIA_ENGINE_STATISTIC_FRAMES_RENDERED, - MF_MEDIA_ENGINE_STATISTIC_FRAMES_DROPPED, - MF_MEDIA_ENGINE_STATISTIC_BYTES_DOWNLOADED, - MF_MEDIA_ENGINE_STATISTIC_BUFFER_PROGRESS, - MF_MEDIA_ENGINE_STATISTIC_FRAMES_PER_SECOND, - MF_MEDIA_ENGINE_STATISTIC_PLAYBACK_JITTER, - MF_MEDIA_ENGINE_STATISTIC_FRAMES_CORRUPTED, - MF_MEDIA_ENGINE_STATISTIC_TOTAL_FRAME_DELAY, -} MF_MEDIA_ENGINE_STATISTIC; - -typedef enum MF_MEDIA_ENGINE_S3D_PACKING_MODE -{ - MF_MEDIA_ENGINE_S3D_PACKING_MODE_NONE, - MF_MEDIA_ENGINE_S3D_PACKING_MODE_SIDE_BY_SIDE, - MF_MEDIA_ENGINE_S3D_PACKING_MODE_TOP_BOTTOM -} MF_MEDIA_ENGINE_S3D_PACKING_MODE; - -typedef enum MF_MEDIA_ENGINE_SEEK_MODE -{ - MF_MEDIA_ENGINE_SEEK_MODE_NORMAL, - MF_MEDIA_ENGINE_SEEK_MODE_APPROXIMATE, -} MF_MEDIA_ENGINE_SEEK_MODE; - -[ - object, - uuid(83015ead-b1e6-40d0-a98a-37145ffe1ad1), - local, - pointer_default(unique) -] -interface IMFMediaEngineEx : IMFMediaEngine -{ - HRESULT SetSourceFromByteStream([in] IMFByteStream *bytestream, [in] BSTR url); - HRESULT GetStatistics([in] MF_MEDIA_ENGINE_STATISTIC stat_id, [out] PROPVARIANT *stat); - HRESULT UpdateVideoStream([in] const MFVideoNormalizedRect *src, - [in] const RECT *dst, [in] const MFARGB *border_color); - double GetBalance(); - HRESULT SetBalance([in] double balance); - BOOL IsPlaybackRateSupported([in] double rate); - HRESULT FrameStep([in] BOOL forward); - HRESULT GetResourceCharacteristics([out] DWORD *flags); - HRESULT GetPresentationAttribute([in] REFGUID attribute, [out] PROPVARIANT *value); - HRESULT GetNumberOfStreams([out] DWORD *stream_count); - HRESULT GetStreamAttribute([in] DWORD stream_index, [in] REFGUID attribute, [out] PROPVARIANT *value); - HRESULT GetStreamSelection([in] DWORD stream_index, [out] BOOL *enabled); - HRESULT SetStreamSelection([in] DWORD stream_index, [in] BOOL enabled); - HRESULT ApplyStreamSelections(); - HRESULT IsProtected([out] BOOL *protected); - HRESULT InsertVideoEffect([in] IUnknown *effect, [in] BOOL is_optional); - HRESULT InsertAudioEffect([in] IUnknown *effect, [in] BOOL is_optional); - HRESULT RemoveAllEffects(); - HRESULT SetTimelineMarkerTimer([in] double timeout); - HRESULT GetTimelineMarkerTimer([out] double *timeout); - HRESULT CancelTimelineMarkerTimer(); - BOOL IsStereo3D(); - HRESULT GetStereo3DFramePackingMode([out] MF_MEDIA_ENGINE_S3D_PACKING_MODE *mode); - HRESULT SetStereo3DFramePackingMode([in] MF_MEDIA_ENGINE_S3D_PACKING_MODE mode); - HRESULT GetStereo3DRenderMode([out] MF3DVideoOutputType *output_type); - HRESULT SetStereo3DRenderMode([in] MF3DVideoOutputType output_type); - HRESULT EnableWindowlessSwapchainMode([in] BOOL enable); - HRESULT GetVideoSwapchainHandle([out] HANDLE *swapchain); - HRESULT EnableHorizontalMirrorMode([in] BOOL enable); - HRESULT GetAudioStreamCategory([out] UINT32 *category); - HRESULT SetAudioStreamCategory([in] UINT32 category); - HRESULT GetAudioEndpointRole([out] UINT32 *role); - HRESULT SetAudioEndpointRole([in] UINT32 role); - HRESULT GetRealTimeMode([out] BOOL *enabled); - HRESULT SetRealTimeMode([in] BOOL enable); - HRESULT SetCurrentTimeEx([in] double seektime, [in] MF_MEDIA_ENGINE_SEEK_MODE mode); - HRESULT EnableTimeUpdateTimer([in] BOOL enable); -} - -[ - object, - uuid(4d645ace-26aa-4688-9be1-df3516990b93), - local, - pointer_default(unique) -] -interface IMFMediaEngineClassFactory : IUnknown -{ - HRESULT CreateInstance([in] DWORD flags, [in] IMFAttributes *attributes, [out] IMFMediaEngine **engine); - HRESULT CreateTimeRange([out] IMFMediaTimeRange **range); - HRESULT CreateError([out] IMFMediaError **error); -} - -[ - object, - uuid(fee7c112-e776-42b5-9bbf-0048524e2bd5), - local, - pointer_default(unique) -] -interface IMFMediaEngineNotify : IUnknown -{ - HRESULT EventNotify([in] DWORD event, [in] DWORD_PTR param1, [in] DWORD param2); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/mfplay.idl b/wrappers/to-synch/sdk/include/reactos/wine/mfplay.idl deleted file mode 100644 index 7d4345e69e7..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/mfplay.idl +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright 2019 Nikolay Sivov for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "unknwn.idl"; -import "propsys.idl"; -import "evr.idl"; - -interface IMFNetCredential; - -typedef UINT32 MFP_CREATION_OPTIONS; - -typedef [v1_enum] enum _MFP_CREATION_OPTIONS -{ - MFP_OPTION_NONE = 0, - MFP_OPTION_FREE_THREADED_CALLBACK = 0x1, - MFP_OPTION_NO_MMCSS = 0x2, - MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION = 0x4, -} _MFP_CREATION_OPTIONS; - -typedef [v1_enum] enum MFP_MEDIAPLAYER_STATE -{ - MFP_MEDIAPLAYER_STATE_EMPTY = 0, - MFP_MEDIAPLAYER_STATE_STOPPED, - MFP_MEDIAPLAYER_STATE_PLAYING, - MFP_MEDIAPLAYER_STATE_PAUSED, - MFP_MEDIAPLAYER_STATE_SHUTDOWN, -} MFP_MEDIAPLAYER_STATE; - -typedef enum MFP_EVENT_TYPE -{ - MFP_EVENT_TYPE_PLAY = 0, - MFP_EVENT_TYPE_PAUSE, - MFP_EVENT_TYPE_STOP, - MFP_EVENT_TYPE_POSITION_SET, - MFP_EVENT_TYPE_RATE_SET, - MFP_EVENT_TYPE_MEDIAITEM_CREATED, - MFP_EVENT_TYPE_MEDIAITEM_SET, - MFP_EVENT_TYPE_FRAME_STEP, - MFP_EVENT_TYPE_MEDIAITEM_CLEARED, - MFP_EVENT_TYPE_MF, - MFP_EVENT_TYPE_ERROR, - MFP_EVENT_TYPE_PLAYBACK_ENDED, - MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL, -} MFP_EVENT_TYPE; - -typedef UINT32 MFP_MEDIAITEM_CHARACTERISTICS; - -typedef [v1_enum] enum _MFP_MEDIAITEM_CHARACTERISTICS -{ - MFP_MEDIAITEM_IS_LIVE = 0x00000001, - MFP_MEDIAITEM_CAN_SEEK = 0x00000002, - MFP_MEDIAITEM_CAN_PAUSE = 0x00000004, - MFP_MEDIAITEM_HAS_SLOW_SEEK = 0x00000008, -} _MFP_MEDIAITEM_CHARACTERISTICS; - -typedef UINT32 MFP_CREDENTIAL_FLAGS; - -typedef [v1_enum] enum _MFP_CREDENTIAL_FLAGS -{ - MFP_CREDENTIAL_PROMPT = 0x00000001, - MFP_CREDENTIAL_SAVE = 0x00000002, - MFP_CREDENTIAL_DO_NOT_CACHE = 0x00000004, - MFP_CREDENTIAL_CLEAR_TEXT = 0x00000008, - MFP_CREDENTIAL_PROXY = 0x00000010, - MFP_CREDENTIAL_LOGGED_ON_USER = 0x00000020, -} _MFP_CREDENTIAL_FLAGS; - -interface IMFPMediaPlayer; -interface IMFPMediaItem; - -typedef struct MFP_EVENT_HEADER -{ - MFP_EVENT_TYPE eEventType; - HRESULT hrEvent; - IMFPMediaPlayer *pMediaPlayer; - MFP_MEDIAPLAYER_STATE eState; - IPropertyStore *pPropertyStore; -} MFP_EVENT_HEADER; - -typedef struct MFP_PLAY_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_PLAY_EVENT; - -typedef struct MFP_PAUSE_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_PAUSE_EVENT; - -typedef struct MFP_STOP_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_STOP_EVENT; - -typedef struct MFP_POSITION_SET_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_POSITION_SET_EVENT; - -typedef struct MFP_RATE_SET_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; - float flRate; -} MFP_RATE_SET_EVENT; - -typedef struct MFP_MEDIAITEM_CREATED_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; - DWORD_PTR dwUserData; -} MFP_MEDIAITEM_CREATED_EVENT; - -typedef struct MFP_MEDIAITEM_SET_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_MEDIAITEM_SET_EVENT; - -typedef struct MFP_FRAME_STEP_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_FRAME_STEP_EVENT; - -typedef struct MFP_MEDIAITEM_CLEARED_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_MEDIAITEM_CLEARED_EVENT; - -typedef struct MFP_MF_EVENT -{ - MFP_EVENT_HEADER header; - MediaEventType MFEventType; - IMFMediaEvent *pMFMediaEvent; - IMFPMediaItem *pMediaItem; -} MFP_MF_EVENT; - -typedef struct MFP_ERROR_EVENT -{ - MFP_EVENT_HEADER header; -} MFP_ERROR_EVENT; - -typedef struct MFP_PLAYBACK_ENDED_EVENT -{ - MFP_EVENT_HEADER header; - IMFPMediaItem *pMediaItem; -} MFP_PLAYBACK_ENDED_EVENT; - -typedef struct MFP_ACQUIRE_USER_CREDENTIAL_EVENT -{ - MFP_EVENT_HEADER header; - DWORD_PTR dwUserData; - BOOL fProceedWithAuthentication; - HRESULT hrAuthenticationStatus; - LPCWSTR pwszURL; - LPCWSTR pwszSite; - LPCWSTR pwszRealm; - LPCWSTR pwszPackage; - LONG nRetries; - MFP_CREDENTIAL_FLAGS flags; - IMFNetCredential *pCredential; -} MFP_ACQUIRE_USER_CREDENTIAL_EVENT; - -cpp_quote("#define __MFP_CAST_EVENT(hdr, tag) (((hdr)->eEventType == MFP_EVENT_TYPE_##tag) ? (MFP_##Tag##_EVENT *)(hdr) : NULL)") -cpp_quote("#define MFP_GET_PLAY_EVENT(hdr) __MFP_CAST_EVENT(hdr, PLAY)") -cpp_quote("#define MFP_GET_PAUSE_EVENT(hdr) __MFP_CAST_EVENT(hdr, PAUSE)") -cpp_quote("#define MFP_GET_STOP_EVENT(hdr) __MFP_CAST_EVENT(hdr, STOP)") -cpp_quote("#define MFP_GET_POSITION_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, POSITION_SET)") -cpp_quote("#define MFP_GET_RATE_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, RATE_SET)") -cpp_quote("#define MFP_GET_MEDIAITEM_CREATED_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_CREATED)") -cpp_quote("#define MFP_GET_MEDIAITEM_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_SET)") -cpp_quote("#define MFP_GET_FRAME_STEP_EVENT(hdr) __MFP_CAST_EVENT(hdr, FRAME_STEP)") -cpp_quote("#define MFP_GET_MEDIAITEM_CLEARED_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_CLEARED)") -cpp_quote("#define MFP_GET_MF_EVENT(hdr) __MFP_CAST_EVENT(hdr, MF)") -cpp_quote("#define MFP_GET_ERROR_EVENT(hdr) __MFP_CAST_EVENT(hdr, ERROR)") -cpp_quote("#define MFP_GET_PLAYBACK_ENDED_EVENT(hdr) __MFP_CAST_EVENT(hdr, PLAYBACK_ENDED)") -cpp_quote("#define MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT(hdr) __MFP_CAST_EVENT(hdr, ACQUIRE_USER_CREDENTIAL)") - -[ - object, - uuid(766c8ffb-5fdb-4fea-a28d-b912996f51bd), - local, -] -interface IMFPMediaPlayerCallback : IUnknown -{ - void OnMediaPlayerEvent([in] MFP_EVENT_HEADER *event_header); -} - -[ - object, - uuid(a714590a-58af-430a-85bf-44f5ec838d85), - local, -] -interface IMFPMediaPlayer : IUnknown -{ - HRESULT Play(); - - HRESULT Pause(); - - HRESULT Stop(); - - HRESULT FrameStep(); - - HRESULT SetPosition( - [in] REFGUID position_type, - [in] const PROPVARIANT *position); - - HRESULT GetPosition( - [in] REFGUID position_type, - [out] PROPVARIANT *position); - - HRESULT GetDuration( - [in] REFGUID position_type, - [out] PROPVARIANT *duration); - - HRESULT SetRate( - [in] float rate); - - HRESULT GetRate( - [out] float *rate); - - HRESULT GetSupportedRates( - [in] BOOL forward, - [out] float *slowest_rate, - [out] float *fastest_rate); - - HRESULT GetState( - [out] MFP_MEDIAPLAYER_STATE *state); - - HRESULT CreateMediaItemFromURL( - [in] const WCHAR *url, - [in] BOOL sync, - [in] DWORD_PTR user_data, - [out] IMFPMediaItem **item); - - HRESULT CreateMediaItemFromObject( - [in] IUnknown *object, - [in] BOOL sync, - [in] DWORD_PTR user_data, - [out] IMFPMediaItem **item); - - HRESULT SetMediaItem( - [in] IMFPMediaItem *item); - - HRESULT ClearMediaItem(); - - HRESULT GetMediaItem( - [out] IMFPMediaItem **item); - - HRESULT GetVolume( - [out] float *volume); - - HRESULT SetVolume( - [in] float volume); - - HRESULT GetBalance( - [out] float *balance); - - HRESULT SetBalance( - [in] float balance); - - HRESULT GetMute( - [out] BOOL *mute); - - HRESULT SetMute( - [in] BOOL mute); - - HRESULT GetNativeVideoSize( - [out] SIZE *video, - [out] SIZE *arvideo); - - HRESULT GetIdealVideoSize( - [out] SIZE *min_size, - [out] SIZE *max_size); - - HRESULT SetVideoSourceRect( - [in] MFVideoNormalizedRect const *rect); - - HRESULT GetVideoSourceRect( - [out] MFVideoNormalizedRect *rect); - - HRESULT SetAspectRatioMode( - [in] DWORD mode); - - HRESULT GetAspectRatioMode( - [out] DWORD *mode); - - HRESULT GetVideoWindow( - [out] HWND *hwnd); - - HRESULT UpdateVideo(); - - HRESULT SetBorderColor( - [in] COLORREF color); - - HRESULT GetBorderColor( - [out] COLORREF *color); - - HRESULT InsertEffect( - [in] IUnknown *effect, - [in] BOOL optional); - - HRESULT RemoveEffect( - [in] IUnknown *effect); - - HRESULT RemoveAllEffects(); - - HRESULT Shutdown(); -} - -[ - object, - uuid(90eb3e6b-ecbf-45cc-b1da-c6fe3ea70d57), - local, -] -interface IMFPMediaItem : IUnknown -{ - HRESULT GetMediaPlayer( - [out] IMFPMediaPlayer **player); - - HRESULT GetURL( - [out] LPWSTR *url); - - HRESULT GetObject( - [out] IUnknown **obj); - - HRESULT GetUserData( - [out] DWORD_PTR *user_data); - - HRESULT SetUserData( - [in] DWORD_PTR user_data); - - HRESULT GetStartStopPosition( - [out] GUID *start_format, - [out] PROPVARIANT *start_position, - [out] GUID *stop_format, - [out] PROPVARIANT *stop_position); - - HRESULT SetStartStopPosition( - [in] const GUID *start_format, - [in] const PROPVARIANT *start_position, - [in] const GUID *stop_format, - [in] const PROPVARIANT *stop_position); - - HRESULT HasVideo( - [out] BOOL *has_video, - [out] BOOL *selected); - - HRESULT HasAudio( - [out] BOOL *has_audio, - [out] BOOL *selected); - - HRESULT IsProtected( - [out] BOOL *protected); - - HRESULT GetDuration( - [in] REFGUID format, - [out] PROPVARIANT *value); - - HRESULT GetNumberOfStreams( - [out] DWORD *count); - - HRESULT GetStreamSelection( - [in] DWORD index, - [out] BOOL *enabled); - - HRESULT SetStreamSelection( - [in] DWORD index, - [in] BOOL enabled); - - HRESULT GetStreamAttribute( - [in] DWORD index, - [in] REFGUID key, - [out] PROPVARIANT *value); - - HRESULT GetPresentationAttribute( - [in] REFGUID key, - [out] PROPVARIANT *value); - - HRESULT GetCharacteristics( - [out] MFP_MEDIAITEM_CHARACTERISTICS *flags); - - HRESULT SetStreamSink( - [in] DWORD index, - [in] IUnknown *sink); - - HRESULT GetMetadata( - [out] IPropertyStore **metadata); -} - -cpp_quote("HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_CREATION_OPTIONS options, ") -cpp_quote(" IMFPMediaPlayerCallback *callback, HWND hwnd, IMFPMediaPlayer **player);") diff --git a/wrappers/to-synch/sdk/include/reactos/wine/mfreadwrite.idl b/wrappers/to-synch/sdk/include/reactos/wine/mfreadwrite.idl deleted file mode 100644 index 46eb5dc9c0f..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/mfreadwrite.idl +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (C) 2017 Alistair Leslie-Hughes - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "mfobjects.idl"; -import "mftransform.idl"; - -typedef [v1_enum] enum MF_SOURCE_READER_CONTROL_FLAG -{ - MF_SOURCE_READER_CONTROLF_DRAIN = 0x00000001, -} MF_SOURCE_READER_CONTROL_FLAG; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(MF_SOURCE_READER_CONTROL_FLAG)") - -enum -{ - MF_SOURCE_READER_INVALID_STREAM_INDEX = 0xffffffff, - MF_SOURCE_READER_ALL_STREAMS = 0xfffffffe, - MF_SOURCE_READER_ANY_STREAM = 0xfffffffe, - MF_SOURCE_READER_FIRST_AUDIO_STREAM = 0xfffffffd, - MF_SOURCE_READER_FIRST_VIDEO_STREAM = 0xfffffffc, - MF_SOURCE_READER_MEDIASOURCE = 0xffffffff, - MF_SOURCE_READER_CURRENT_TYPE_INDEX = 0xffffffff -}; - -typedef [v1_enum] enum MF_SOURCE_READER_FLAG -{ - MF_SOURCE_READERF_ERROR = 0x00000001, - MF_SOURCE_READERF_ENDOFSTREAM = 0x00000002, - MF_SOURCE_READERF_NEWSTREAM = 0x00000004, - MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED = 0x00000010, - MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED = 0x00000020, - MF_SOURCE_READERF_STREAMTICK = 0x00000100, - MF_SOURCE_READERF_ALLEFFECTSREMOVED = 0x00000200, -} MF_SOURCE_READER_FLAG; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(MF_SOURCE_READER_FLAG)") - -enum -{ - MF_SINK_WRITER_INVALID_STREAM_INDEX = 0xffffffff, - MF_SINK_WRITER_ALL_STREAMS = 0xfffffffe, - MF_SINK_WRITER_MEDIASINK = 0xffffffff, -}; - -typedef struct _MF_SINK_WRITER_STATISTICS -{ - DWORD cb; - LONGLONG llLastTimestampReceived; - LONGLONG llLastTimestampEncoded; - LONGLONG llLastTimestampProcessed; - LONGLONG llLastStreamTickReceived; - LONGLONG llLastSinkSampleRequest; - QWORD qwNumSamplesReceived; - QWORD qwNumSamplesEncoded; - QWORD qwNumSamplesProcessed; - QWORD qwNumStreamTicksReceived; - DWORD dwByteCountQueued; - QWORD qwByteCountProcessed; - DWORD dwNumOutstandingSinkSampleRequests; - DWORD dwAverageSampleRateReceived; - DWORD dwAverageSampleRateEncoded; - DWORD dwAverageSampleRateProcessed; -} MF_SINK_WRITER_STATISTICS; - -cpp_quote("EXTERN_GUID(CLSID_MFReadWriteClassFactory, 0x48e2ed0f, 0x98c2, 0x4a37, 0xbe, 0xd5, 0x16, 0x63, 0x12, 0xdd, 0xd8, 0x3f);") -cpp_quote("EXTERN_GUID(CLSID_MFSourceReader, 0x1777133c, 0x0881, 0x411b, 0xa5, 0x77, 0xad, 0x54, 0x5f, 0x07, 0x14, 0xc4);") -cpp_quote("EXTERN_GUID(CLSID_MFSinkWriter, 0xa3bbfb17, 0x8273, 0x4e52, 0x9e, 0x0e, 0x97, 0x39, 0xdc, 0x88, 0x79, 0x90);") - -cpp_quote("EXTERN_GUID(MF_MEDIASINK_AUTOFINALIZE_SUPPORTED, 0x48c131be, 0x135a, 0x41cb, 0x82, 0x90, 0x03, 0x65, 0x25, 0x09, 0xc9, 0x99);") -cpp_quote("EXTERN_GUID(MF_MEDIASINK_ENABLE_AUTOFINALIZE, 0x34014265, 0xcb7e, 0x4cde, 0xac, 0x7c, 0xef, 0xfd, 0x3b, 0x3c, 0x25, 0x30);") - -cpp_quote("EXTERN_GUID(MF_SINK_WRITER_ASYNC_CALLBACK, 0x48cb183e, 0x7b0b, 0x46f4, 0x82, 0x2e, 0x5e, 0x1d, 0x2d, 0xda, 0x43, 0x54);") -cpp_quote("EXTERN_GUID(MF_SINK_WRITER_DISABLE_THROTTLING, 0x08b845d8, 0x2b74, 0x4afe, 0x9d, 0x53, 0xbe, 0x16, 0xd2, 0xd5, 0xae, 0x4f);") -cpp_quote("EXTERN_GUID(MF_SINK_WRITER_D3D_MANAGER, 0xec822da2, 0xe1e9, 0x4b29, 0xa0, 0xd8, 0x56, 0x3c, 0x71, 0x9f, 0x52, 0x69);") -cpp_quote("EXTERN_GUID(MF_SINK_WRITER_ENCODER_CONFIG, 0xad91cd04, 0xa7cc, 0x4ac7, 0x99, 0xb6, 0xa5, 0x7b, 0x9a, 0x4a, 0x7c, 0x70);") - -cpp_quote("EXTERN_GUID(MF_READWRITE_DISABLE_CONVERTERS, 0x98d5b065, 0x1374, 0x4847, 0x8d, 0x5d, 0x31, 0x52, 0x0f, 0xee, 0x71, 0x56);") -cpp_quote("EXTERN_GUID(MF_READWRITE_ENABLE_AUTOFINALIZE, 0xdd7ca129, 0x8cd1, 0x4dc5, 0x9d, 0xde, 0xce, 0x16, 0x86, 0x75, 0xde, 0x61);") -cpp_quote("EXTERN_GUID(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 0xa634a91c, 0x822b, 0x41b9, 0xa4, 0x94, 0x4d, 0xe4, 0x64, 0x36, 0x12, 0xb0);") -cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS, 0x39384300, 0xd0eb, 0x40b1, 0x87, 0xa0, 0x33, 0x18, 0x87, 0x1b, 0x5a, 0x53);") -cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY, 0x43ad19ce, 0xf33f, 0x4ba9, 0xa5, 0x80, 0xe4, 0xcd, 0x12, 0xf2, 0xd1, 0x44);") -cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x0890, 0x4b0e, 0x93, 0x8c, 0x05, 0x43, 0x32, 0xc5, 0x47, 0xe1);") -cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61);") -cpp_quote("EXTERN_GUID(MF_READWRITE_D3D_OPTIONAL, 0x216479d9, 0x3071, 0x42ca, 0xbb, 0x6c, 0x4c, 0x22, 0x10, 0x2e, 0x1d, 0x18);") - -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ASYNC_CALLBACK, 0x1e3dbeac, 0xbb43, 0x4c35, 0xb5, 0x07, 0xcd, 0x64, 0x44, 0x64, 0xc9, 0x65);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_D3D_MANAGER, 0xec822da2, 0xe1e9, 0x4b29, 0xa0, 0xd8, 0x56, 0x3c, 0x71, 0x9f, 0x52, 0x69);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_D3D11_BIND_FLAGS, 0x33f3197b, 0xf73a, 0x4e14, 0x8d, 0x85, 0x0e, 0x4c, 0x43, 0x68, 0x78, 0x8d);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISABLE_CAMERA_PLUGINS, 0x9d3365dd, 0x058f, 0x4cfb, 0x9f, 0x97, 0xb3, 0x14, 0xcc, 0x99, 0xc8, 0xad);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISABLE_DXVA, 0xaa456cfd, 0x3943, 0x4a1e, 0xa7, 0x7d, 0x18, 0x38, 0xc0, 0xea, 0x2e, 0x35);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, 0x56b67165, 0x219e, 0x456d, 0xa2, 0x2e, 0x2d, 0x30, 0x04, 0xc7, 0xfe, 0x56);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, 0x0f81da2c, 0xb537, 0x4672, 0xa8, 0xb2, 0xa6, 0x81, 0xb1, 0x73, 0x07, 0xa3);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS, 0xdfd4f008, 0xb5fd, 0x4e78, 0xae, 0x44, 0x62, 0xa1, 0xe6, 0x7b, 0xbe, 0x27);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, 0xfb394f3d, 0xccf1, 0x42ee, 0xbb, 0xb3, 0xf9, 0xb8, 0x45, 0xd5, 0x68, 0x1d);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);") -cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CONFIG, 0x9085abeb, 0x0354, 0x48f9, 0xab, 0xb5, 0x20, 0x0d, 0xf8, 0x38, 0xc6, 0x8e);") - -[ - object, - uuid(deec8d99-fa1d-4d82-84c2-2c8969944867), - local -] -interface IMFSourceReaderCallback : IUnknown -{ - HRESULT OnReadSample( - [in] HRESULT hr, - [in] DWORD stream_index, - [in] DWORD stream_flags, - [in] LONGLONG timestamp, - [in] IMFSample *sample); - - HRESULT OnFlush([in] DWORD stream_index); - - HRESULT OnEvent( - [in] DWORD stream_index, - [in] IMFMediaEvent *event); -} - -[ - object, - uuid(cf839fe6-8c2a-4dd2-b6ea-c22d6961af05), - local -] -interface IMFSourceReaderCallback2 : IMFSourceReaderCallback -{ - HRESULT OnTransformChange(); - - HRESULT OnStreamError( - [in] DWORD stream_index, - [in] HRESULT status); -} - -interface IMFMediaSource; - -[ - object, - uuid(70ae66f2-c809-4e4f-8915-bdcb406b7993), - local -] -interface IMFSourceReader : IUnknown -{ - HRESULT GetStreamSelection([in] DWORD index, [out] BOOL *selected); - HRESULT SetStreamSelection([in] DWORD index, [in] BOOL selected); - HRESULT GetNativeMediaType([in] DWORD index, [in] DWORD typeindex, [out] IMFMediaType **type); - HRESULT GetCurrentMediaType([in] DWORD index, [out] IMFMediaType **type); - HRESULT SetCurrentMediaType([in] DWORD index, [in, out] DWORD *reserved, [in] IMFMediaType *type); - HRESULT SetCurrentPosition([in] REFGUID format, [in] REFPROPVARIANT position); - HRESULT ReadSample([in] DWORD index, [in] DWORD flags, [out] DWORD *actualindex, [out] DWORD *sampleflags, - [out] LONGLONG *timestamp, [out] IMFSample **sample); - HRESULT Flush([in] DWORD index); - HRESULT GetServiceForStream([in] DWORD index, [in] REFGUID service, [in] REFIID riid, [out] void **object); - HRESULT GetPresentationAttribute([in] DWORD index, [in] REFGUID guid, [out] PROPVARIANT *attr); -} - -[ - object, - uuid(7b981cf0-560e-4116-9875-b099895f23d7), - local -] -interface IMFSourceReaderEx : IMFSourceReader -{ - HRESULT SetNativeMediaType( - [in] DWORD stream_index, - [in] IMFMediaType *media_type, - [out] DWORD *stream_flags); - - HRESULT AddTransformForStream( - [in] DWORD stream_index, - [in] IUnknown *transform); - - HRESULT RemoveAllTransformsForStream( - [in] DWORD stream_index); - - HRESULT GetTransformForStream( - [in] DWORD stream_index, - [in] DWORD transform_index, - [out] GUID *category, - [out] IMFTransform **transform); -} - -[ - object, - uuid(3137f1cd-fe5e-4805-a5d8-fb477448cb3d), - local -] -interface IMFSinkWriter : IUnknown -{ - HRESULT AddStream([in] IMFMediaType *type, [out] DWORD *index); - HRESULT SetInputMediaType([in] DWORD index, [in] IMFMediaType *type, [in] IMFAttributes *parameters); - HRESULT BeginWriting(void); - HRESULT WriteSample([in] DWORD index, [in] IMFSample *sample); - HRESULT SendStreamTick([in] DWORD index, [in] LONGLONG timestamp); - HRESULT PlaceMarker([in] DWORD index, [in] void *context); - HRESULT NotifyEndOfSegment([in] DWORD index); - HRESULT Flush([in] DWORD index); - HRESULT Finalize(void); - HRESULT GetServiceForStream([in] DWORD index, [in] REFGUID service, [in] REFIID riid, [out] void **object); - HRESULT GetStatistics([in] DWORD index, [out] MF_SINK_WRITER_STATISTICS *stats); -} - -[ - object, - uuid(588d72ab-5Bc1-496a-8714-b70617141b25), - local -] -interface IMFSinkWriterEx : IMFSinkWriter -{ - HRESULT GetTransformForStream([in] DWORD index, [in] DWORD tindex, [out] GUID *category, - [out] IMFTransform **transform); -} - -[ - object, - uuid(17c3779e-3cde-4ede-8c60-3899f5f53ad6), - local -] -interface IMFSinkWriterEncoderConfig : IUnknown -{ - HRESULT SetTargetMediaType( - [in] DWORD stream_index, - [in] IMFMediaType *media_type, - [in] IMFAttributes *encoding_parameters); - - HRESULT PlaceEncodingParameters( - [in] DWORD stream_index, - [in] IMFAttributes *encoding_parameters); -} - -[ - object, - uuid(666f76de-33d2-41b9-a458-29ed0a972c58), - local -] -interface IMFSinkWriterCallback : IUnknown -{ - HRESULT OnFinalize( - [in] HRESULT status); - - HRESULT OnMarker( - [in] DWORD stream_index, - [in] void *context); -} - -[ - object, - uuid(2456bd58-c067-4513-84fe-8d0c88ffdc61), - local -] -interface IMFSinkWriterCallback2 : IMFSinkWriterCallback -{ - HRESULT OnTransformChange(); - - HRESULT OnStreamError( - [in] DWORD stream_index, - [in] HRESULT status); -} - -[ - object, - uuid(e7fe2e12-661c-40da-92f9-4f002ab67627), - local -] -interface IMFReadWriteClassFactory : IUnknown -{ - HRESULT CreateInstanceFromURL([in] REFCLSID clsid, [in] LPCWSTR url, [in] IMFAttributes *attributes, - [in] REFIID riid, [out, iid_is(riid)] void **object ); - - HRESULT CreateInstanceFromObject([in] REFCLSID clsid, [in] IUnknown *unk, [in] IMFAttributes *attributes, - [in] REFIID riid, [out, iid_is(riid)] void **object ); -} - -cpp_quote( "HRESULT WINAPI MFCreateSinkWriterFromMediaSink(IMFMediaSink *sink, IMFAttributes *attributes," ) -cpp_quote( " IMFSinkWriter **writer);" ) -cpp_quote( "HRESULT WINAPI MFCreateSinkWriterFromURL(const WCHAR *url, IMFByteStream *bytestream," ) -cpp_quote( " IMFAttributes *attributes, IMFSinkWriter **writer);" ) -cpp_quote( "HRESULT WINAPI MFCreateSourceReaderFromByteStream(IMFByteStream *stream, IMFAttributes *attributes," ) -cpp_quote( " IMFSourceReader **reader);" ) -cpp_quote( "HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAttributes *attributes," ) -cpp_quote( " IMFSourceReader **reader);" ) -cpp_quote( "HRESULT WINAPI MFCreateSourceReaderFromURL(const WCHAR *url, IMFAttributes *attributes, IMFSourceReader **reader);" ) diff --git a/wrappers/to-synch/sdk/include/reactos/wine/orpc.idl b/wrappers/to-synch/sdk/include/reactos/wine/orpc.idl deleted file mode 100644 index 4ddc8ac3b3e..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/orpc.idl +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2003 Ove Kåven, TransGaming Technologies - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#pragma makedep header - -import "unknwn.idl"; - -[ - uuid(99fcfe60-5260-101b-bbcb-00aa0021347a), - pointer_default(unique) -] -interface ObjectRpcBaseTypes -{ - typedef unsigned hyper ID; - typedef ID MID; - typedef ID OXID; - typedef ID OID; - typedef ID SETID; - typedef GUID IPID; - typedef GUID CID; - typedef REFGUID REFIPID; - - const unsigned short COM_MINOR_VERSION_1 = 1; - const unsigned short COM_MINOR_VERSION_2 = 2; - - const unsigned short COM_MAJOR_VERSION = 5; - const unsigned short COM_MINOR_VERSION = 3; - - typedef struct tagCOMVERSION - { - unsigned short MajorVersion; - unsigned short MinorVersion; - } COMVERSION; - - const unsigned long ORPCF_NULL = 0; - const unsigned long ORPCF_LOCAL = 1; - const unsigned long ORPCF_RESERVED1 = 2; - const unsigned long ORPCF_RESERVED2 = 4; - const unsigned long ORPCF_RESERVED3 = 8; - const unsigned long ORPCF_RESERVED4 = 16; - - typedef struct tagORPC_EXTENT - { - GUID id; - unsigned long size; - [size_is((size + 7) & ~7)] byte data[]; - } ORPC_EXTENT; - - typedef struct tagORPC_EXTENT_ARRAY - { - unsigned long size; - unsigned long reserved; - [size_is((size + 1) & ~1,), unique] ORPC_EXTENT **extent; - } ORPC_EXTENT_ARRAY; - - typedef struct tagORPCTHIS - { - COMVERSION version; - unsigned long flags; - unsigned long reserved1; - CID cid; - [unique] ORPC_EXTENT_ARRAY *extensions; - } ORPCTHIS; - - typedef struct tagORPCTHAT - { - unsigned long flags; - [unique] ORPC_EXTENT_ARRAY *extensions; - } ORPCTHAT; - - const unsigned short NCADG_IP_UDP = 0x08; - const unsigned short NCACN_IP_TCP = 0x07; - const unsigned short NCADG_IPX = 0x0E; - const unsigned short NCACN_SPX = 0x0C; - const unsigned short NCACN_NB_NB = 0x12; - const unsigned short NCACN_NB_IPX = 0x0D; - const unsigned short NCACN_DNET_NSP = 0x04; - const unsigned short NCACN_HTTP = 0x1F; - - typedef struct tagSTRINGBINDING - { - unsigned short wTowerId; - [string] WCHAR aNetworkAddr[]; - } STRINGBINDING; - - const unsigned short COM_C_AUTHZ_NONE = 0xffff; - - typedef struct tagSECURITYBINDING - { - unsigned short wAuthnSvc; - unsigned short wAuthzSvc; - [string] WCHAR aPrincName[]; - } SECURITYBINDING; - - typedef struct tagDUALSTRINGARRAY - { - unsigned short wNumEntries; - unsigned short wSecurityOffset; - [size_is(wNumEntries)] unsigned short aStringArray[]; - } DUALSTRINGARRAY; - - typedef struct tagOXID_INFO - { - DWORD dwTid; - DWORD dwPid; - IPID ipidRemUnknown; - DWORD dwAuthnHint; - DUALSTRINGARRAY *psa; - } OXID_INFO; - - const unsigned long OBJREF_SIGNATURE = 0x574f454d; /* "MEOW" */ - const unsigned long OBJREF_STANDARD = 0x1; - const unsigned long OBJREF_HANDLER = 0x2; - const unsigned long OBJREF_CUSTOM = 0x4; - const unsigned long SORF_OXRES1 = 0x1; - const unsigned long SORF_OXRES2 = 0x20; - const unsigned long SORF_OXRES3 = 0x40; - const unsigned long SORF_OXRES4 = 0x80; - const unsigned long SORF_OXRES5 = 0x100; - const unsigned long SORF_OXRES6 = 0x200; - const unsigned long SORF_OXRES7 = 0x400; - const unsigned long SORF_OXRES8 = 0x800; - const unsigned long SORF_NULL = 0x0; - const unsigned long SORF_NOPING = 0x1000; - - typedef struct tagSTDOBJREF - { - unsigned long flags; - unsigned long cPublicRefs; - OXID oxid; - OID oid; - IPID ipid; - } STDOBJREF; - - typedef struct tagOBJREF - { - unsigned long signature; - unsigned long flags; - GUID iid; - [switch_is(flags)] - union - { - [case(OBJREF_STANDARD)] - struct OR_STANDARD - { - STDOBJREF std; - DUALSTRINGARRAY saResAddr; - } u_standard; - - [case(OBJREF_HANDLER)] - struct OR_HANDLER - { - STDOBJREF std; - CLSID clsid; - DUALSTRINGARRAY saResAddr; - } u_handler; - - [case(OBJREF_CUSTOM)] - struct OR_CUSTOM - { - CLSID clsid; - unsigned long cbExtension; - ULONG size; - [size_is(size), ref] byte *pData; - } u_custom; - } u_objref; - } OBJREF; - - typedef struct tagMInterfacePointer - { - ULONG ulCntData; - [size_is(ulCntData)] BYTE abData[]; - } MInterfacePointer; - - typedef [unique] MInterfacePointer *PMInterfacePointer; -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/roapi.h b/wrappers/to-synch/sdk/include/reactos/wine/roapi.h deleted file mode 100644 index bcaa8e9fea0..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/roapi.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2014 Martin Storsjo - * Copyright (C) 2016 Michael Müller - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_ROAPI_H -#define __WINE_ROAPI_H - -#include -#include - -typedef enum -{ - RO_INIT_SINGLETHREADED = 0, - RO_INIT_MULTITHREADED = 1, -} RO_INIT_TYPE; - -DECLARE_HANDLE(APARTMENT_SHUTDOWN_REGISTRATION_COOKIE); - -#ifdef __cplusplus -typedef struct {} *RO_REGISTRATION_COOKIE; -#else -typedef struct _RO_REGISTRATION_COOKIE *RO_REGISTRATION_COOKIE; -#endif -typedef HRESULT (WINAPI *PFNGETACTIVATIONFACTORY)(HSTRING, IActivationFactory **); - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI RoActivateInstance(HSTRING classid, IInspectable **instance); -HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_factory); -HRESULT WINAPI RoInitialize(RO_INIT_TYPE type); -void WINAPI RoUninitialize(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_ROAPI_H */ diff --git a/wrappers/to-synch/sdk/include/reactos/wine/rtworkq.idl b/wrappers/to-synch/sdk/include/reactos/wine/rtworkq.idl deleted file mode 100644 index 32132961bd8..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/rtworkq.idl +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2020 Nikolay Sivov for CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "unknwn.idl"; - -typedef enum -{ - RTWQ_STANDARD_WORKQUEUE = 0, - RTWQ_WINDOW_WORKQUEUE = 1, - RTWQ_MULTITHREADED_WORKQUEUE = 2, -} RTWQ_WORKQUEUE_TYPE; - -typedef unsigned __int64 RTWQWORKITEM_KEY; - -[ - object, - uuid(ac6b7889-0740-4d51-8619-905994a55cc6), - local -] -interface IRtwqAsyncResult : IUnknown -{ - HRESULT GetState([out] IUnknown **state); - HRESULT GetStatus(); - HRESULT SetStatus([in] HRESULT status); - HRESULT GetObject([out] IUnknown **object); - IUnknown *GetStateNoAddRef(); -} - -[ - object, - uuid(a27003cf-2354-4f2a-8d6a-ab7cff15437e), - local -] -interface IRtwqAsyncCallback : IUnknown -{ - HRESULT GetParameters([out] DWORD *flags, [out] DWORD *queue); - HRESULT Invoke([in] IRtwqAsyncResult *result); -} - -[ - object, - uuid(63d9255a-7ff1-4b61-8faf-ed6460dacf2b), - local -] -interface IRtwqPlatformEvents : IUnknown -{ - HRESULT InitializationComplete(void); - HRESULT ShutdownStart(void); - HRESULT ShutdownComplete(void); -} - -cpp_quote("#define RTWQ_E_ERROR(x) ((HRESULT)(0xc00d0000L+x))") -cpp_quote("#define RTWQ_E_BUFFERTOOSMALL RTWQ_E_ERROR(14001)") -cpp_quote("#define RTWQ_E_NOT_INITIALIZED RTWQ_E_ERROR(14006)") -cpp_quote("#define RTWQ_E_UNEXPECTED RTWQ_E_ERROR(14011)") -cpp_quote("#define RTWQ_E_NOT_FOUND RTWQ_E_ERROR(14037)") -cpp_quote("#define RTWQ_E_OPERATION_CANCELLED RTWQ_E_ERROR(14061)") -cpp_quote("#define RTWQ_E_INVALID_WORKQUEUE RTWQ_E_ERROR(14079)") -cpp_quote("#define RTWQ_E_SHUTDOWN RTWQ_E_ERROR(16005)") - -cpp_quote("#ifdef __WINESRC__") -cpp_quote("typedef struct tagRTWQASYNCRESULT") -cpp_quote("{") -cpp_quote(" IRtwqAsyncResult AsyncResult;") -cpp_quote("#else") -cpp_quote("typedef struct tagRTWQASYNCRESULT : public IRtwqAsyncResult {") -cpp_quote("#endif") -cpp_quote(" OVERLAPPED overlapped;") -cpp_quote(" IRtwqAsyncCallback *pCallback;") -cpp_quote(" HRESULT hrStatusResult;") -cpp_quote(" DWORD dwBytesTransferred;") -cpp_quote(" HANDLE hEvent;") -cpp_quote("} RTWQASYNCRESULT;") - -cpp_quote("typedef void (WINAPI *RTWQPERIODICCALLBACK)(IUnknown *context);") - -cpp_quote("HRESULT WINAPI RtwqAddPeriodicCallback(RTWQPERIODICCALLBACK callback, IUnknown *context, DWORD *key);") -cpp_quote("HRESULT WINAPI RtwqAllocateSerialWorkQueue(DWORD target_queue, DWORD *queue);") -cpp_quote("HRESULT WINAPI RtwqAllocateWorkQueue(RTWQ_WORKQUEUE_TYPE queue_type, DWORD *queue);") -cpp_quote("HRESULT WINAPI RtwqBeginRegisterWorkQueueWithMMCSS(DWORD queue, const WCHAR *mmcss_class, DWORD taskid, LONG priority, IRtwqAsyncCallback *callback, IUnknown *state);") -cpp_quote("HRESULT WINAPI RtwqBeginUnregisterWorkQueueWithMMCSS(DWORD queue, IRtwqAsyncCallback *callback, IUnknown *state);") -cpp_quote("HRESULT WINAPI RtwqCancelDeadline(HANDLE request);") -cpp_quote("HRESULT WINAPI RtwqCancelWorkItem(RTWQWORKITEM_KEY key);") -cpp_quote("HRESULT WINAPI RtwqCreateAsyncResult(IUnknown *object, IRtwqAsyncCallback *callback, IUnknown *state, IRtwqAsyncResult **result);") -cpp_quote("HRESULT WINAPI RtwqEndRegisterWorkQueueWithMMCSS(IRtwqAsyncResult *result, DWORD *taskid);") -cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSClass(DWORD queue, WCHAR *mmcss_class, DWORD *length);") -cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSPriority(DWORD queue, LONG *priority);") -cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSTaskId(DWORD queue, DWORD *taskid);") -cpp_quote("HRESULT WINAPI RtwqInvokeCallback(IRtwqAsyncResult *result);") -cpp_quote("HRESULT WINAPI RtwqJoinWorkQueue(DWORD queue, HANDLE hFile, HANDLE *cookie);") -cpp_quote("HRESULT WINAPI RtwqLockPlatform(void);") -cpp_quote("HRESULT WINAPI RtwqLockSharedWorkQueue(const WCHAR *usageclass, LONG priority, DWORD *taskid, DWORD *queue);") -cpp_quote("HRESULT WINAPI RtwqLockWorkQueue(DWORD queue);") -cpp_quote("HRESULT WINAPI RtwqPutWaitingWorkItem(HANDLE event, LONG priority, IRtwqAsyncResult *result, RTWQWORKITEM_KEY *key);") -cpp_quote("HRESULT WINAPI RtwqPutWorkItem(DWORD queue, LONG priority, IRtwqAsyncResult *result);") -cpp_quote("HRESULT WINAPI RtwqRegisterPlatformEvents(IRtwqPlatformEvents *events);") -cpp_quote("HRESULT WINAPI RtwqRegisterPlatformWithMMCSS(const WCHAR *mmcss_class, DWORD *taskid, LONG priority);") -cpp_quote("HRESULT WINAPI RtwqRemovePeriodicCallback(DWORD key);") -cpp_quote("HRESULT WINAPI RtwqScheduleWorkItem(IRtwqAsyncResult *result, INT64 timeout, RTWQWORKITEM_KEY *key);") -cpp_quote("HRESULT WINAPI RtwqSetDeadline(DWORD queue_id, LONGLONG deadline, HANDLE *request);") -cpp_quote("HRESULT WINAPI RtwqSetDeadline2(DWORD queue_id, LONGLONG deadline, LONGLONG predeadline, HANDLE *request);") -cpp_quote("HRESULT WINAPI RtwqSetLongRunning(DWORD queue_id, BOOL enable);") -cpp_quote("HRESULT WINAPI RtwqShutdown(void);") -cpp_quote("HRESULT WINAPI RtwqStartup(void);") -cpp_quote("HRESULT WINAPI RtwqUnjoinWorkQueue(DWORD queue, HANDLE cookie);") -cpp_quote("HRESULT WINAPI RtwqUnlockPlatform(void);") -cpp_quote("HRESULT WINAPI RtwqUnlockWorkQueue(DWORD queue);") -cpp_quote("HRESULT WINAPI RtwqUnregisterPlatformEvents(IRtwqPlatformEvents *events);") -cpp_quote("HRESULT WINAPI RtwqUnregisterPlatformFromMMCSS(void);") diff --git a/wrappers/to-synch/sdk/include/reactos/wine/schrpc.idl b/wrappers/to-synch/sdk/include/reactos/wine/schrpc.idl deleted file mode 100644 index 944f283081a..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/schrpc.idl +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Task Scheduler Service definitions - * - * Copyright 2014 Dmitry Timoshkov - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -cpp_quote("#define SCHEDSVC_TRANSPORT {'n','c','a','l','r','p','c',0}") -cpp_quote("#define SCH_FLAG_STATE 0x10000000") - -import "oaidl.idl"; -import "ocidl.idl"; - -[ - uuid(86d35949-83c9-4044-b424-db363231fd0c), - implicit_handle(handle_t schrpc_handle), - version(1.0), - pointer_default(unique) -] -interface ITaskSchedulerService -{ - typedef struct _TASK_USER_CRED - { - [string] const WCHAR *user; - [string] const WCHAR *password; - DWORD flags; - } TASK_USER_CRED; - - typedef struct _TASK_XML_ERROR_INFO - { - DWORD line, column; - [string] WCHAR *node; - [string] WCHAR *value; - } TASK_XML_ERROR_INFO; - - typedef [string] WCHAR **TASK_NAMES; - - HRESULT SchRpcHighestVersion([out] DWORD *version); - HRESULT SchRpcRegisterTask([in, string, unique] const WCHAR *path, - [in, string] const WCHAR *xml, [in] DWORD flags, - [in, string, unique] const WCHAR *sddl, - [in] DWORD task_logon_type, [in] DWORD n_creds, - [in, size_is(n_creds), unique] const TASK_USER_CRED *creds, - [out, string] WCHAR **actual_path, - [out] TASK_XML_ERROR_INFO **xml_error_info); - HRESULT SchRpcRetrieveTask([in, string] const WCHAR *path, - [in, string] const WCHAR *languages, - [in] unsigned long *n_languages, [out, string] WCHAR **xml); - HRESULT SchRpcCreateFolder([in, string] const WCHAR *path, - [in, string, unique] const WCHAR *sddl, [in] DWORD flags); - HRESULT SchRpcSetSecurity([in, string] const WCHAR *path, - [in, string] const WCHAR *sddl, [in] DWORD flags); - HRESULT SchRpcGetSecurity([in, string] const WCHAR *path, - [in] DWORD flags, [out, string] WCHAR **sddl); - HRESULT SchRpcEnumFolders([in, string] const WCHAR *path, - [in] DWORD flags, [in, out] DWORD *start_index, - [in] DWORD n_requested, [out] DWORD *n_names, - [out, string, size_is(,*n_names)] TASK_NAMES *names); - HRESULT SchRpcEnumTasks([in, string] const WCHAR *path, - [in] DWORD flags, [in, out] DWORD *start_index, - [in] DWORD n_requested, [out] DWORD *n_names, - [out, string, size_is(,*n_names)] TASK_NAMES *names); - HRESULT SchRpcEnumInstances([in, string, unique] const WCHAR *path, - [in] DWORD flags, [out] DWORD *n_guids, - [out, size_is(,*n_guids)] GUID **guids); - HRESULT SchRpcGetInstanceInfo([in] GUID guid, [out, string] WCHAR **path, - [out] DWORD *task_state, [out, string] WCHAR **action, - [out, string] WCHAR **info, [out] DWORD *n_instances, - [out, size_is(,*n_instances)] GUID **instances, [out] DWORD *pid); - HRESULT SchRpcStopInstance([in] GUID guid, [in] DWORD flags); - HRESULT SchRpcStop([in, string, unique] const WCHAR *path, [in] DWORD flags); - HRESULT SchRpcRun([in, string] const WCHAR *path, - [in] DWORD n_args, [in, size_is(n_args),unique] const WCHAR **args, - [in] DWORD flags, [in] DWORD session_id, - [in, unique, string] const WCHAR *user, [out] GUID *guid); - HRESULT SchRpcDelete([in, string] const WCHAR *path, [in] DWORD flags); - HRESULT SchRpcRename([in, string] const WCHAR *path, [in, string] const WCHAR *name, [in] DWORD flags); - HRESULT SchRpcScheduledRuntimes([in, string] const WCHAR *path, - [in, unique] SYSTEMTIME *start, [in, unique] SYSTEMTIME *end, - [in] DWORD flags, [in] DWORD n_requested, [out] DWORD *n_runtimes, - [out, size_is(,*n_runtimes)] SYSTEMTIME **runtimes); - HRESULT SchRpcGetLastRunInfo([in, string] const WCHAR *path, - [out] SYSTEMTIME *last_runtime, [out] DWORD *last_return_code); - HRESULT SchRpcGetTaskInfo([in, string] const WCHAR *path, [in] DWORD flags, - [out] DWORD *enabled, [out] DWORD *task_state); - HRESULT SchRpcGetNumberOfMissedRuns([in, string] const WCHAR *path, [out] DWORD *runs); - HRESULT SchRpcEnableTask([in, string] const WCHAR *path, [in] DWORD enabled); -} diff --git a/wrappers/to-synch/sdk/include/reactos/wine/strmbase.h b/wrappers/to-synch/sdk/include/reactos/wine/strmbase.h deleted file mode 100644 index 4d9c9f02685..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/strmbase.h +++ /dev/null @@ -1,814 +0,0 @@ -/* - * Header file for Wine's strmbase implementation - * - * Copyright 2003 Robert Shearman - * Copyright 2010 Aric Stewart, CodeWeavers - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#pragma once - -#include "wine/list.h" - -HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc); -void WINAPI FreeMediaType(AM_MEDIA_TYPE * pMediaType); -AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const * pSrc); -void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType); - -/* Pin functions */ - -typedef struct BasePin -{ - IPin IPin_iface; - LONG refCount; - LPCRITICAL_SECTION pCritSec; - PIN_INFO pinInfo; - IPin * pConnectedTo; - AM_MEDIA_TYPE mtCurrent; - REFERENCE_TIME tStart; - REFERENCE_TIME tStop; - double dRate; - - const struct BasePinFuncTable* pFuncsTable; -} BasePin; - -typedef HRESULT (WINAPI *BasePin_CheckMediaType)(BasePin *This, const AM_MEDIA_TYPE *pmt); -typedef HRESULT (WINAPI *BasePin_AttemptConnection)(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt); -typedef LONG (WINAPI *BasePin_GetMediaTypeVersion)(BasePin *This); -typedef HRESULT (WINAPI *BasePin_GetMediaType)(BasePin *This, int iPosition, AM_MEDIA_TYPE *amt); - -typedef struct BasePinFuncTable { - /* Required for Input Pins*/ - BasePin_CheckMediaType pfnCheckMediaType; - /* Required for Output Pins*/ - BasePin_AttemptConnection pfnAttemptConnection; - /* Required for BasePinImpl_EnumMediaTypes */ - BasePin_GetMediaTypeVersion pfnGetMediaTypeVersion; - BasePin_GetMediaType pfnGetMediaType; -} BasePinFuncTable; - -typedef struct BaseOutputPin -{ - /* inheritance C style! */ - BasePin pin; - IMemInputPin * pMemInputPin; - IMemAllocator * pAllocator; - - const struct BaseOutputPinFuncTable* pFuncsTable; -} BaseOutputPin; - -typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); -typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This); - -typedef struct BaseOutputPinFuncTable { - BasePinFuncTable base; - - /* Required for BaseOutputPinImpl_DecideAllocator */ - BaseOutputPin_DecideBufferSize pfnDecideBufferSize; - /* Required for BaseOutputPinImpl_AttemptConnection */ - BaseOutputPin_DecideAllocator pfnDecideAllocator; - BaseOutputPin_BreakConnect pfnBreakConnect; -} BaseOutputPinFuncTable; - -typedef struct BaseInputPin -{ - /* inheritance C style! */ - BasePin pin; - - IMemInputPin IMemInputPin_iface; - IMemAllocator * pAllocator; - BOOL flushing, end_of_stream; - IMemAllocator *preferred_allocator; - - const struct BaseInputPinFuncTable* pFuncsTable; -} BaseInputPin; - -typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample); - -typedef struct BaseInputPinFuncTable { - BasePinFuncTable base; - /* Optional */ - BaseInputPin_Receive pfnReceive; -} BaseInputPinFuncTable; - -/* Base Pin */ -HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt); -LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This); -ULONG WINAPI BasePinImpl_AddRef(IPin * iface); -HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface); -HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin); -HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo); -HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir); -HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id); -HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum); -HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin); -HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); - -/* Base Output Pin */ -HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface); -HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface); -HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin * iface); -HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin * iface); -HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface); - -HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags); -HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin * This, IMediaSample * pSample); -HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin * This); -HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin * This); -HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin * This); -HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc); -HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); - -HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); -HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This); - -/* Base Input Pin */ -HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI BaseInputPinImpl_Release(IPin * iface); -HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface); -HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface); -HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface); -HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); - -HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo, - const BaseInputPinFuncTable* pBaseInputFuncsTable, - LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin); -HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This); - -typedef struct BaseFilter -{ - IBaseFilter IBaseFilter_iface; - LONG refCount; - CRITICAL_SECTION csFilter; - - FILTER_STATE state; - REFERENCE_TIME rtStreamStart; - IReferenceClock * pClock; - FILTER_INFO filterInfo; - CLSID clsid; - LONG pinVersion; - - const struct BaseFilterFuncTable* pFuncsTable; -} BaseFilter; - -typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition); -typedef LONG (WINAPI *BaseFilter_GetPinCount)(BaseFilter* iface); -typedef LONG (WINAPI *BaseFilter_GetPinVersion)(BaseFilter* iface); - -typedef struct BaseFilterFuncTable { - /* Required */ - BaseFilter_GetPin pfnGetPin; - BaseFilter_GetPinCount pfnGetPinCount; -} BaseFilterFuncTable; - -HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter * iface); -ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface); -HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid); -HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState ); -HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock); -HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock); -HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum); -HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo); -HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ); -HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo); - -LONG WINAPI BaseFilterImpl_GetPinVersion(BaseFilter* This); -VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This); - -HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable* pBaseFuncsTable); -HRESULT WINAPI BaseFilter_Destroy(BaseFilter * This); - -/* Enums */ -HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum); - -HRESULT WINAPI EnumPins_Construct(BaseFilter *base, BaseFilter_GetPin receive_pin, BaseFilter_GetPinCount receive_pincount, BaseFilter_GetPinVersion receive_version, IEnumPins ** ppEnum); - -/* Transform Filter */ -typedef struct TransformFilter -{ - BaseFilter filter; - - IPin **ppPins; - ULONG npins; - AM_MEDIA_TYPE pmt; - CRITICAL_SECTION csReceive; - - const struct TransformFilterFuncTable * pFuncsTable; - struct QualityControlImpl *qcimpl; - /* IMediaSeeking and IMediaPosition are implemented by ISeekingPassThru */ - IUnknown *seekthru_unk; -} TransformFilter; - -typedef HRESULT (WINAPI *TransformFilter_DecideBufferSize) (TransformFilter *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); -typedef HRESULT (WINAPI *TransformFilter_StartStreaming) (TransformFilter *iface); -typedef HRESULT (WINAPI *TransformFilter_StopStreaming) (TransformFilter *iface); -typedef HRESULT (WINAPI *TransformFilter_Receive) (TransformFilter* iface, IMediaSample* pIn); -typedef HRESULT (WINAPI *TransformFilter_CompleteConnect) (TransformFilter *iface, PIN_DIRECTION dir, IPin *pPin); -typedef HRESULT (WINAPI *TransformFilter_BreakConnect) (TransformFilter *iface, PIN_DIRECTION dir); -typedef HRESULT (WINAPI *TransformFilter_SetMediaType) (TransformFilter *iface, PIN_DIRECTION dir, const AM_MEDIA_TYPE *pMediaType); -typedef HRESULT (WINAPI *TransformFilter_CheckInputType) (TransformFilter *iface, const AM_MEDIA_TYPE *pMediaType); -typedef HRESULT (WINAPI *TransformFilter_EndOfStream) (TransformFilter *iface); -typedef HRESULT (WINAPI *TransformFilter_BeginFlush) (TransformFilter *iface); -typedef HRESULT (WINAPI *TransformFilter_EndFlush) (TransformFilter *iface); -typedef HRESULT (WINAPI *TransformFilter_NewSegment) (TransformFilter *iface, -REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); -typedef HRESULT (WINAPI *TransformFilter_Notify) (TransformFilter *iface, IBaseFilter *sender, Quality qm); - -typedef struct TransformFilterFuncTable { - /* Required */ - TransformFilter_DecideBufferSize pfnDecideBufferSize; - /* Optional */ - TransformFilter_StartStreaming pfnStartStreaming; - TransformFilter_Receive pfnReceive; - TransformFilter_StopStreaming pfnStopStreaming; - TransformFilter_CheckInputType pfnCheckInputType; - TransformFilter_SetMediaType pfnSetMediaType; - TransformFilter_CompleteConnect pfnCompleteConnect; - TransformFilter_BreakConnect pfnBreakConnect; - TransformFilter_EndOfStream pfnEndOfStream; - TransformFilter_BeginFlush pfnBeginFlush; - TransformFilter_EndFlush pfnEndFlush; - TransformFilter_NewSegment pfnNewSegment; - TransformFilter_Notify pfnNotify; -} TransformFilterFuncTable; - -HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface); -HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter * iface); -HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter * iface); -HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart); -HRESULT WINAPI TransformFilterImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin); -HRESULT WINAPI TransformFilterImpl_Notify(TransformFilter *iface, IBaseFilter *sender, Quality qm); - -HRESULT TransformFilter_Construct( const IBaseFilterVtbl *filterVtbl, LONG filter_size, const CLSID* pClsid, const TransformFilterFuncTable* pFuncsTable, IBaseFilter ** ppTransformFilter); - -/* Source Seeking */ -typedef HRESULT (WINAPI *SourceSeeking_ChangeRate)(IMediaSeeking *iface); -typedef HRESULT (WINAPI *SourceSeeking_ChangeStart)(IMediaSeeking *iface); -typedef HRESULT (WINAPI *SourceSeeking_ChangeStop)(IMediaSeeking *iface); - -typedef struct SourceSeeking -{ - IMediaSeeking IMediaSeeking_iface; - - ULONG refCount; - SourceSeeking_ChangeStop fnChangeStop; - SourceSeeking_ChangeStart fnChangeStart; - SourceSeeking_ChangeRate fnChangeRate; - DWORD dwCapabilities; - double dRate; - LONGLONG llCurrent, llStop, llDuration; - GUID timeformat; - PCRITICAL_SECTION crst; -} SourceSeeking; - -HRESULT SourceSeeking_Init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *Vtbl, SourceSeeking_ChangeStop fnChangeStop, SourceSeeking_ChangeStart fnChangeStart, SourceSeeking_ChangeRate fnChangeRate, PCRITICAL_SECTION crit_sect); - -HRESULT WINAPI SourceSeekingImpl_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities); -HRESULT WINAPI SourceSeekingImpl_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities); -HRESULT WINAPI SourceSeekingImpl_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat); -HRESULT WINAPI SourceSeekingImpl_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat); -HRESULT WINAPI SourceSeekingImpl_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat); -HRESULT WINAPI SourceSeekingImpl_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat); -HRESULT WINAPI SourceSeekingImpl_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat); -HRESULT WINAPI SourceSeekingImpl_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration); -HRESULT WINAPI SourceSeekingImpl_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop); -HRESULT WINAPI SourceSeekingImpl_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent); -HRESULT WINAPI SourceSeekingImpl_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat); -HRESULT WINAPI SourceSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags); -HRESULT WINAPI SourceSeekingImpl_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop); -HRESULT WINAPI SourceSeekingImpl_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest); -HRESULT WINAPI SourceSeekingImpl_SetRate(IMediaSeeking * iface, double dRate); -HRESULT WINAPI SourceSeekingImpl_GetRate(IMediaSeeking * iface, double * dRate); -HRESULT WINAPI SourceSeekingImpl_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll); - -/* PosPassThru */ -HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start); -HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface); -HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface); - -HRESULT WINAPI CreatePosPassThru(IUnknown* pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru); -HRESULT WINAPI PosPassThru_Construct(IUnknown* pUnkOuter, LPVOID *ppPassThru); - -/* Filter Registration */ - -typedef REGPINTYPES AMOVIESETUP_MEDIATYPE; -typedef REGFILTERPINS AMOVIESETUP_PIN; - -typedef struct AMOVIESETUP_FILTER { - const CLSID *clsid; - const WCHAR *name; - DWORD merit; - UINT pins; - const AMOVIESETUP_PIN *pPin; -} AMOVIESETUP_FILTER, *LPAMOVIESETUP_FILTER; - -typedef IUnknown *(CALLBACK *LPFNNewCOMObject)(LPUNKNOWN pUnkOuter, HRESULT *phr); -typedef void (CALLBACK *LPFNInitRoutine)(BOOL bLoading, const CLSID *rclsid); - -typedef struct tagFactoryTemplate { - const WCHAR *m_Name; - const CLSID *m_ClsID; - LPFNNewCOMObject m_lpfnNew; - LPFNInitRoutine m_lpfnInit; - const AMOVIESETUP_FILTER *m_pAMovieSetup_Filter; -} FactoryTemplate; - -HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister); -HRESULT WINAPI AMovieSetupRegisterFilter2(const AMOVIESETUP_FILTER *pFilter, IFilterMapper2 *pIFM2, BOOL bRegister); - -/* Output Queue */ -typedef struct tagOutputQueue { - CRITICAL_SECTION csQueue; - - BaseOutputPin * pInputPin; - - HANDLE hThread; - HANDLE hProcessQueue; - - LONG lBatchSize; - BOOL bBatchExact; - BOOL bTerminate; - BOOL bSendAnyway; - - struct list SampleList; - - const struct OutputQueueFuncTable* pFuncsTable; -} OutputQueue; - -typedef DWORD (WINAPI *OutputQueue_ThreadProc)(OutputQueue *This); - -typedef struct OutputQueueFuncTable -{ - OutputQueue_ThreadProc pfnThreadProc; -} OutputQueueFuncTable; - -HRESULT WINAPI OutputQueue_Construct( BaseOutputPin *pInputPin, BOOL bAuto, - BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority, - const OutputQueueFuncTable* pFuncsTable, OutputQueue **ppOutputQueue ); -HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue); -HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSample **ppSamples, LONG nSamples, LONG *nSamplesProcessed); -HRESULT WINAPI OutputQueue_Receive(OutputQueue *pOutputQueue, IMediaSample *pSample); -VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue); -VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue); -DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue); - -typedef struct tagBaseWindow -{ - HWND hWnd; - LONG Width; - LONG Height; - HINSTANCE hInstance; - LPWSTR pClassName; - DWORD ClassStyles; - DWORD WindowStyles; - DWORD WindowStylesEx; - HDC hDC; - - const struct BaseWindowFuncTable* pFuncsTable; -} BaseWindow; - -typedef LPWSTR (WINAPI *BaseWindow_GetClassWindowStyles)(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx); -typedef RECT (WINAPI *BaseWindow_GetDefaultRect)(BaseWindow *This); -typedef BOOL (WINAPI *BaseWindow_PossiblyEatMessage)(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam); -typedef LRESULT (WINAPI *BaseWindow_OnReceiveMessage)(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam); -typedef BOOL (WINAPI *BaseWindow_OnSize)(BaseWindow *This, LONG Height, LONG Width); - -typedef struct BaseWindowFuncTable -{ - /* Required */ - BaseWindow_GetClassWindowStyles pfnGetClassWindowStyles; - BaseWindow_GetDefaultRect pfnGetDefaultRect; - /* Optional, WinProc Related */ - BaseWindow_OnReceiveMessage pfnOnReceiveMessage; - BaseWindow_PossiblyEatMessage pfnPossiblyEatMessage; - BaseWindow_OnSize pfnOnSize; -} BaseWindowFuncTable; - -HRESULT WINAPI BaseWindow_Init(BaseWindow *pBaseWindow, const BaseWindowFuncTable* pFuncsTable); -HRESULT WINAPI BaseWindow_Destroy(BaseWindow *pBaseWindow); - -HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This); -HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This); -RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This); -LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam); -BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width); - -typedef struct{ - ITypeInfo *pTypeInfo; -} BaseDispatch; - -HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid); -HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This); -HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid); -HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo); -HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo); - -#ifdef __IVideoWindow_FWD_DEFINED__ -typedef struct tagBaseControlWindow -{ - BaseWindow baseWindow; - IVideoWindow IVideoWindow_iface; - BaseDispatch baseDispatch; - - BOOL AutoShow; - HWND hwndDrain; - HWND hwndOwner; - BaseFilter* pFilter; - CRITICAL_SECTION* pInterfaceLock; - BasePin* pPin; -} BaseControlWindow; - -HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseWindowFuncTable* pFuncsTable); -HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow); - -BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam); -HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT*pctinfo); -HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo); -HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId); -HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr); -HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR strCaption); -HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *strCaption); -HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG WindowStyle); -HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG *WindowStyle); -HRESULT WINAPI BaseControlWindowImpl_put_WindowStyleEx(IVideoWindow *iface, LONG WindowStyleEx); -HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG *WindowStyleEx); -HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow); -HRESULT WINAPI BaseControlWindowImpl_get_AutoShow(IVideoWindow *iface, LONG *AutoShow); -HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG WindowState); -HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState); -HRESULT WINAPI BaseControlWindowImpl_put_BackgroundPalette(IVideoWindow *iface, LONG BackgroundPalette); -HRESULT WINAPI BaseControlWindowImpl_get_BackgroundPalette(IVideoWindow *iface, LONG *pBackgroundPalette); -HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG Visible); -HRESULT WINAPI BaseControlWindowImpl_get_Visible(IVideoWindow *iface, LONG *pVisible); -HRESULT WINAPI BaseControlWindowImpl_put_Left(IVideoWindow *iface, LONG Left); -HRESULT WINAPI BaseControlWindowImpl_get_Left(IVideoWindow *iface, LONG *pLeft); -HRESULT WINAPI BaseControlWindowImpl_put_Width(IVideoWindow *iface, LONG Width); -HRESULT WINAPI BaseControlWindowImpl_get_Width(IVideoWindow *iface, LONG *pWidth); -HRESULT WINAPI BaseControlWindowImpl_put_Top(IVideoWindow *iface, LONG Top); -HRESULT WINAPI BaseControlWindowImpl_get_Top(IVideoWindow *iface, LONG *pTop); - -HRESULT WINAPI BaseControlWindowImpl_put_Height(IVideoWindow *iface, LONG Height); -HRESULT WINAPI BaseControlWindowImpl_get_Height(IVideoWindow *iface, LONG *pHeight); -HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner); -HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owner); -HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain); -HRESULT WINAPI BaseControlWindowImpl_get_MessageDrain(IVideoWindow *iface, OAHWND *Drain); -HRESULT WINAPI BaseControlWindowImpl_get_BorderColor(IVideoWindow *iface, LONG *Color); -HRESULT WINAPI BaseControlWindowImpl_put_BorderColor(IVideoWindow *iface, LONG Color); -HRESULT WINAPI BaseControlWindowImpl_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode); -HRESULT WINAPI BaseControlWindowImpl_put_FullScreenMode(IVideoWindow *iface, LONG FullScreenMode); -HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus); -HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, LONG Left, LONG Top, LONG Width, LONG Height); -HRESULT WINAPI BaseControlWindowImpl_GetWindowPosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlWindowImpl_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, LONG uMsg, LONG_PTR wParam, LONG_PTR lParam); -HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor); -HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden); -#endif - -#ifdef __IBasicVideo_FWD_DEFINED__ -#ifdef __amvideo_h__ -typedef struct tagBaseControlVideo -{ - IBasicVideo IBasicVideo_iface; - BaseDispatch baseDispatch; - - BaseFilter* pFilter; - CRITICAL_SECTION* pInterfaceLock; - BasePin* pPin; - - const struct BaseControlVideoFuncTable* pFuncsTable; -} BaseControlVideo; - -typedef HRESULT (WINAPI *BaseControlVideo_GetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); -typedef HRESULT (WINAPI *BaseControlVideo_GetStaticImage)(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage); -typedef HRESULT (WINAPI *BaseControlVideo_GetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); -typedef VIDEOINFOHEADER* (WINAPI *BaseControlVideo_GetVideoFormat)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultSourceRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultTargetRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultSourceRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultTargetRect)(BaseControlVideo* This); -typedef HRESULT (WINAPI *BaseControlVideo_SetSourceRect)(BaseControlVideo* This, RECT *pSourceRect); -typedef HRESULT (WINAPI *BaseControlVideo_SetTargetRect)(BaseControlVideo* This, RECT *pTargetRect); - -typedef struct BaseControlVideoFuncTable { - /* Required */ - BaseControlVideo_GetSourceRect pfnGetSourceRect; - BaseControlVideo_GetStaticImage pfnGetStaticImage; - BaseControlVideo_GetTargetRect pfnGetTargetRect; - BaseControlVideo_GetVideoFormat pfnGetVideoFormat; - BaseControlVideo_IsDefaultSourceRect pfnIsDefaultSourceRect; - BaseControlVideo_IsDefaultTargetRect pfnIsDefaultTargetRect; - BaseControlVideo_SetDefaultSourceRect pfnSetDefaultSourceRect; - BaseControlVideo_SetDefaultTargetRect pfnSetDefaultTargetRect; - BaseControlVideo_SetSourceRect pfnSetSourceRect; - BaseControlVideo_SetTargetRect pfnSetTargetRect; -} BaseControlVideoFuncTable; - -HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseControlVideoFuncTable* pFuncsTable); -HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); - -HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT*pctinfo); -HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo); -HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId); -HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr); -HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame); -HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate); -HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate); -HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth); -HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight); -HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft); -HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft); -HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth); -HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth); -HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop); -HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop); -HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight); -HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight); -HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft); -HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft); -HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth); -HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth); -HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop); -HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop); -HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight); -HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight); -HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height); -HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface); -HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height); -HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface); -HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight); -HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette); -HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage); -HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface); -HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface); -#endif -#endif - -/* BaseRenderer Filter */ -typedef struct BaseRendererTag -{ - BaseFilter filter; - - BaseInputPin *pInputPin; - IUnknown *pPosition; - CRITICAL_SECTION csRenderLock; - HANDLE evComplete; - HANDLE ThreadSignal; - HANDLE RenderEvent; - IMediaSample *pMediaSample; - - IQualityControl *pQSink; - struct QualityControlImpl *qcimpl; - - const struct BaseRendererFuncTable * pFuncsTable; -} BaseRenderer; - -typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(BaseRenderer *This, const AM_MEDIA_TYPE *pmt); -typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnReceiveFirstSample)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnRenderEnd)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnRenderStart)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnStartStreaming)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_OnStopStreaming)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_OnWaitEnd)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_OnWaitStart)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_PrepareRender)(BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_ShouldDrawSampleNow)(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime); -typedef HRESULT (WINAPI *BaseRenderer_PrepareReceive)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_BeginFlush) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (BaseRenderer *This, IPin *pReceivePin); - -typedef struct BaseRendererFuncTable { - /* Required */ - BaseRenderer_CheckMediaType pfnCheckMediaType; - BaseRenderer_DoRenderSample pfnDoRenderSample; - /* Optional, Data Handlers */ - BaseRenderer_OnReceiveFirstSample pfnOnReceiveFirstSample; - BaseRenderer_OnRenderEnd pfnOnRenderEnd; - BaseRenderer_OnRenderStart pfnOnRenderStart; - BaseRenderer_OnStartStreaming pfnOnStartStreaming; - BaseRenderer_OnStopStreaming pfnOnStopStreaming; - BaseRenderer_OnWaitEnd pfnOnWaitEnd; - BaseRenderer_OnWaitStart pfnOnWaitStart; - BaseRenderer_PrepareRender pfnPrepareRender; - BaseRenderer_ShouldDrawSampleNow pfnShouldDrawSampleNow; - BaseRenderer_PrepareReceive pfnPrepareReceive; - /* Optional, Input Pin */ - BaseRenderer_CompleteConnect pfnCompleteConnect; - BaseRenderer_BreakConnect pfnBreakConnect; - BaseRenderer_EndOfStream pfnEndOfStream; - BaseRenderer_BeginFlush pfnBeginFlush; - BaseRenderer_EndFlush pfnEndFlush; -} BaseRendererFuncTable; - -HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI BaseRendererImpl_Release(IBaseFilter * iface); -HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample); -HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin); -HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface); -HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart); -HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface); -HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock); -HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState); -HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface); -HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface); -HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface); -HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface); - -HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable* pBaseFuncsTable); - -#ifdef __IBasicAudio_FWD_DEFINED__ -typedef struct tagBasicAudio -{ - IBasicAudio IBasicAudio_iface; - BaseDispatch baseDispatch; -} BasicAudio; - -HRESULT WINAPI BasicAudio_Init(BasicAudio *This, const IBasicAudioVtbl *Vtbl); -HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio); - -HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT*pctinfo); -HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); -HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); -HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr); -#endif - -/* Dll Functions */ -BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv); -HRESULT WINAPI STRMBASE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv); -HRESULT WINAPI STRMBASE_DllCanUnloadNow(void); - -struct strmbase_filter -{ - IBaseFilter IBaseFilter_iface; - IUnknown IUnknown_inner; - IUnknown *outer_unk; - LONG refcount; - CRITICAL_SECTION csFilter; - - FILTER_STATE state; - IReferenceClock *clock; - WCHAR name[128]; - IFilterGraph *graph; - CLSID clsid; - LONG pin_version; - - const struct strmbase_filter_ops *ops; -}; - -/* Pin functions */ - -struct strmbase_pin -{ - IPin IPin_iface; - struct strmbase_filter *filter; - PIN_DIRECTION dir; - WCHAR name[128]; - IPin *peer; - AM_MEDIA_TYPE mt; - - const struct strmbase_pin_ops *ops; -}; - -struct strmbase_sink -{ - struct strmbase_pin pin; - - IMemInputPin IMemInputPin_iface; - IMemAllocator *pAllocator; - BOOL flushing; - IMemAllocator *preferred_allocator; - - const struct strmbase_sink_ops *pFuncsTable; -}; - -enum strmbase_type_id -{ - IBasicAudio_tid, - IBasicVideo_tid, - IMediaControl_tid, - IMediaEvent_tid, - IMediaPosition_tid, - IVideoWindow_tid, - last_tid -}; - -HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **typeinfo); -void strmbase_release_typelibs(void); - -struct strmbase_passthrough -{ - ISeekingPassThru ISeekingPassThru_iface; - IMediaSeeking IMediaSeeking_iface; - IMediaPosition IMediaPosition_iface; - - IUnknown *outer_unk; - IPin *pin; - BOOL renderer; - BOOL timevalid; - CRITICAL_SECTION time_cs; - REFERENCE_TIME time_earliest; -}; - -void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer); -void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough); - -void strmbase_passthrough_eos(struct strmbase_passthrough *passthrough); -void strmbase_passthrough_invalidate_time(struct strmbase_passthrough *passthrough); -void strmbase_passthrough_update_time(struct strmbase_passthrough *passthrough, REFERENCE_TIME time); - -struct strmbase_qc -{ - IQualityControl IQualityControl_iface; - struct strmbase_pin *pin; - IQualityControl *tonotify; - - /* Render stuff */ - REFERENCE_TIME last_in_time, last_left, avg_duration, avg_pt, avg_render, start, stop; - REFERENCE_TIME current_jitter, current_rstart, current_rstop, clockstart; - double avg_rate; - LONG64 rendered, dropped; - BOOL qos_handled, is_dropped; -}; - -void strmbase_qc_init(struct strmbase_qc *qc, struct strmbase_pin *pin); - -struct strmbase_renderer -{ - struct strmbase_filter filter; - struct strmbase_passthrough passthrough; - struct strmbase_qc qc; - - struct strmbase_sink sink; - - CRITICAL_SECTION csRenderLock; - /* Signaled when the filter has completed a state change. The filter waits - * for this event in IBaseFilter::GetState(). */ - HANDLE state_event; - /* Signaled when the sample presentation time occurs. The streaming thread - * waits for this event in Receive() if applicable. */ - HANDLE advise_event; - /* Signaled when a flush or state change occurs, i.e. anything that needs - * to immediately unblock the streaming thread. */ - HANDLE flush_event; - REFERENCE_TIME stream_start; - - const struct strmbase_renderer_ops *pFuncsTable; - - BOOL eos; -}; - -// typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt); -// typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(struct strmbase_renderer *iface, IMediaSample *sample); -// typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (struct strmbase_renderer *iface); - -struct strmbase_renderer_ops -{ - HRESULT (*renderer_query_accept)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt); - HRESULT (*renderer_render)(struct strmbase_renderer *iface, IMediaSample *sample); - void (*renderer_init_stream)(struct strmbase_renderer *iface); - void (*renderer_start_stream)(struct strmbase_renderer *iface); - void (*renderer_stop_stream)(struct strmbase_renderer *iface); - HRESULT (*renderer_connect)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt); - void (*renderer_disconnect)(struct strmbase_renderer *iface); - void (*renderer_destroy)(struct strmbase_renderer *iface); - HRESULT (*renderer_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); - HRESULT (*renderer_pin_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); -}; - -void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, - const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops); -void strmbase_renderer_cleanup(struct strmbase_renderer *filter); \ No newline at end of file diff --git a/wrappers/to-synch/sdk/include/reactos/wine/winstring.h b/wrappers/to-synch/sdk/include/reactos/wine/winstring.h deleted file mode 100644 index 27c299b9470..00000000000 --- a/wrappers/to-synch/sdk/include/reactos/wine/winstring.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2014 Martin Storsjo - * - * 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.1 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_WINSTRING_H -#define __WINE_WINSTRING_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI WindowsCompareStringOrdinal(HSTRING str1, HSTRING str2, INT32 *order); -HRESULT WINAPI WindowsConcatString(HSTRING str1, HSTRING str2, HSTRING *out); -HRESULT WINAPI WindowsCreateString(LPCWSTR ptr, UINT32 len, HSTRING *out); -HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len, - HSTRING_HEADER *header, HSTRING *out); -HRESULT WINAPI WindowsDeleteString(HSTRING str); -HRESULT WINAPI WindowsDeleteStringBuffer(HSTRING_BUFFER buf); -HRESULT WINAPI WindowsDuplicateString(HSTRING str, HSTRING *out); -UINT32 WINAPI WindowsGetStringLen(HSTRING str); -LPCWSTR WINAPI WindowsGetStringRawBuffer(HSTRING str, UINT32 *len); -BOOL WINAPI WindowsIsStringEmpty(HSTRING str); -HRESULT WINAPI WindowsPreallocateStringBuffer(UINT32 len, WCHAR **outptr, HSTRING_BUFFER *out); -HRESULT WINAPI WindowsPromoteStringBuffer(HSTRING_BUFFER buf, HSTRING *out); -HRESULT WINAPI WindowsReplaceString(HSTRING haystack, HSTRING needle, HSTRING replacement, - HSTRING *out); -HRESULT WINAPI WindowsStringHasEmbeddedNull(HSTRING str, BOOL *out); -HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 pos, HSTRING *out); -HRESULT WINAPI WindowsSubstringWithSpecifiedLength(HSTRING str, UINT32 pos, - UINT32 len, HSTRING *out); -HRESULT WINAPI WindowsTrimStringEnd(HSTRING str, HSTRING charstr, HSTRING *out); -HRESULT WINAPI WindowsTrimStringStart(HSTRING str, HSTRING charstr, HSTRING *out); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_WINSTRING_H */