;------------------------------------------------------------------------
;
;   Copyright and Disclaimer:
;
;     --------------------------------------------------------------- 
;     This software is provided "AS IS" without warranty of any kind, 
;     either expressed or implied, including but not limited to the 
;     implied warranties of noninfringement, merchantability and/or 
;     fitness for a particular purpose.
;     --------------------------------------------------------------- 
;
;     Copyright (c) 2015-2016 Hauppauge Computer Works, Inc.
;     Copyright (C) 2012-2016 ITE Technologies, Inc.
;     All rights reserved. 
;     ---------------------------------------------------------------
;
;   Abstract:
;
;       This is the HD PVR 60 Driver INF file
;
;------------------------------------------------------------------------


[Version]
signature="$CHICAGO$"
Class=Media
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
Provider=%MfgName%
DriverVer=02/18/2016,16.2.18.34049
CatalogFile=HcwG4bda.cat

[DestinationDirs]
IT9517BDA.CopyDrivers=10,System32\Drivers

[SourceDisksNames]
1=%IT9517BDA.Disc%,,,DriverG4             ;32/64bit machine, Non-Bit-Specific Components
2=%IT9517BDA.Disc64%,,,"DriverG4\64bit"   ;64bit machine, 64bit components
3=%IT9517BDA.DiscWOW%,,,"DriverG4\WOW64"  ;64bit machine, 32bit components (WOW64)

[SourceDisksFiles]
hcwG4bda.sys=1

[Manufacturer]
%MfgName%=HCW

[ControlFlags]
ExcludeFromSelect=*
ExcludeFromSelect.NT=*

;[HCW.NTamd64]
;%IT9517BDA.DeviceDesc% = IT9517BDA.Device,USB\VID_048D&PID_9517
;%hcwG4bda.DeviceDesc%  = IT9517BDA.Device,USB\VID_2040&PID_F810

;[HCW.NTIA64]
;%IT9517BDA.DeviceDesc% = IT9517BDA.Device,USB\VID_048D&PID_9517
;%hcwG4bda.DeviceDesc%  = IT9517BDA.Device,USB\VID_2040&PID_F810

[HCW]
%IT9517BDA.DeviceDesc% = IT9517BDA.Device,USB\VID_048D&PID_9517
%hcwG4bda.DeviceDesc%  = IT9517BDA.Device,USB\VID_2040&PID_F810


[IT9517BDA.Device.NT]
Include    = ks.inf, kscaptur.inf, bda.inf
Needs      = KS.Registration,KSCAPTUR.Registration.NT,BDA.Installation.NT
DelReg	   = IT9517BDA.DeleteReg
;AddReg    = IT9517BDA_DemodInit.AddReg
AddReg     = IT9517BDA.AddReg
CopyFiles  = IT9517BDA.CopyDrivers


[IT9517BDA.Device.NT.Services]
Addservice = IT9517BDA, 0x00000002, IT9517BDA.AddService

[IT9517BDA.AddService]
DisplayName    = %hcwG4bda.FriendlyName%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %10%\System32\Drivers\hcwG4bda.sys
LoadOrderGroup = Base

[IT9517BDA.CopyDrivers]
hcwG4bda.sys

[IT9517BDA.DeleteReg]
HKLM,System\CurrentControlSet\SERVICES\IT9517BDA\DemodInit


;[IT9517BDA_DemodInit.AddReg]
;HKLM,System\CurrentControlSet\SERVICES\IT9517BDA\DemodInit,InitScriptPatch,%REG_DWORD%,0x00
;HKLM,System\CurrentControlSet\SERVICES\IT9517BDA\DemodInit,2,%REG_EXPAND_SZ%,SERVICE_BOOT_START
;HKLM,System\CurrentControlSet\SERVICES\IT9517BDA\DemodInit,1,0x00010001,0x9b,0xd5,0x08,0x01
;HKLM,System\CurrentControlSet\SERVICES\IT9517BDA\DemodInit,2,0x00010001,0x9b,0xd5,0x08,0x01


[IT9517BDA.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,IT9517GB.sys
HKR,,PageOutWhenUnopened,3,01
;HKLM,System\CurrentControlSet\Control\MediaCategories\{1A9333B6-3704-4b18-A6DD-E1979FC56970}
;HKLM,System\CurrentControlSet\Control\MediaCategories\{1A9333B6-3704-4b18-A6DD-E1979FC56970},Display,0x00010001,0
;HKLM,System\CurrentControlSet\Control\MediaCategories\{1A9333B6-3704-4b18-A6DD-E1979FC56970},Name,,"Tuner Node"
;HKLM,System\CurrentControlSet\Control\MediaCategories\{F65394A2-A018-4307-8D12-35AA494A406F}
;HKLM,System\CurrentControlSet\Control\MediaCategories\{F65394A2-A018-4307-8D12-35AA494A406F},Display,0x00010001,0
;HKLM,System\CurrentControlSet\Control\MediaCategories\{F65394A2-A018-4307-8D12-35AA494A406F},Name,,"Demodulator Node"
;HKLM,System\CurrentControlSet\Control\MediaCategories\{870E4D6F-77E7-4c40-ADE3-BEF8708A9D52}
;HKLM,System\CurrentControlSet\Control\MediaCategories\{870E4D6F-77E7-4c40-ADE3-BEF8708A9D52},Display,0x00010001,0
;HKLM,System\CurrentControlSet\Control\MediaCategories\{870E4D6F-77E7-4c40-ADE3-BEF8708A9D52},Name,,"Antenna In Pin"

[IT9517BDA.Device.NT.Interfaces]
;AddInterface=%GUID.TunerCatID%,%KSNAME_Filter%,IT9517BDA.Interfaces,
;AddInterface=%GUID.BdaReceiverCtrl%,%KSNAME_Filter%,IT9517BDA.Interfaces,
;AddInterface=%GUID.TunerCatID%,%KSNAME_Filter2%,IT9517BDA2.Interfaces,
;AddInterface=%GUID.BdaReceiverCtrl%,%KSNAME_Filter2%,IT9517BDA2.Interfaces,
AddInterface=%KSCATEGORY_WDMSYS%,%GUID_AIRHD_CAPTURE_FILTER%,CaptureInterface.NT,
AddInterface=%KSCATEGORY_CROSSBAR%, %IT_GUID_XBAR%, IT9910HD.Filter.XBar
AddInterface = %KSCATEGORY_ENCODER%, %IT_GUID_ENCODER%, IT9910HD.Filter.Encoder
AddInterface = %KSCATEGORY_MULTIPLEXER%, %IT_GUID_ENCODER%, IT9910HD.Filter.Encoder
;AddInterface = %KSCATEGORY_TVTUNER%, %IT_GUID_TVTUNER%, IT9910HD.Filter.TVTuner,0
AddInterface = %KSCATEGORY_CAPTURE%, %IT_GUID_CAPTURE%, IT9910HD.Filter.Capture
AddInterface = %KSCATEGORY_VIDEO%, %IT_GUID_CAPTURE%, IT9910HD.Filter.Capture

;Eagle Tx
[CaptureInterface.NT]
AddReg=avshws.Reader.AddReg,

[avshws.Reader.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%avshws.Reader.FriendlyName%


;XBar
[IT9910HD.Filter.XBar]
AddReg = IT9910HD.Filter.XBar.AddReg

[IT9910HD.Filter.XBar.Addreg]
HKR,,CLSID,,%CLSID.KSXBar%
HKR,,FriendlyName,,%IT9910HD.Filter.XBar.Desc%


[IT9910HD.Filter.Encoder]
AddReg = IT9910HD.Filter.Encoder.AddReg


[IT9910HD.Filter.Encoder.Addreg]
HKR,,CLSID,,%CLSID.KSProxy%
HKR,,FriendlyName,,%IT9910HD.Filter.Encoder.Desc%
;HKR,Interfaces\{B43C4EEC-8C32-4791-9102-508ADA5EE8E7},,,
;HKR,Interfaces\{b05dabd9-56e5-4fdc-afa4-8a47e91f1c9c},,,
;HKR,Capabilities,,,
;HKR,Capabilities,"{12345678-1234-1234-1234-12345678abcd}",,guid1


;TVTuner
[IT9910HD.Filter.TVTuner]
AddReg = IT9910HD.Filter.TVTuner.AddReg, IT9910HD.PinNames.AddReg, IT9910HD.Category.AddReg

[IT9910HD.Filter.TVTuner.AddReg]
HKR,,CLSID,,%CLSID.KSTvTuner%
HKR,,FriendlyName,,%IT9910HD.Filter.TVTuner.Desc%

[IT9910HD.PinNames.AddReg]
HKLM,%MediaCategories%\%IT_GUID_PINNAME_TVAUDIOIN%,Name,,"TV Audio In"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_TVAUDIOOUT%,Name,,"TV Audio Out"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_TVTUNER_VIDEOOUT%,Name,,"Analog Video Out"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_TVTUNER_AUDIOOUT%,Name,,"Analog Audio Out"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_ENCODER_VIDEOIN%,Name,,"Video In"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_ENCODER_AUDIOIN%,Name,,"Audio In"
;HKLM,%MediaCategories%\%IT_GUID_PINNAME_CAPTURE_VBI%,Name,,"VBI"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_CAPTURE_VIDEOIN%,Name,,"Analog Video In"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_CAPTURE_AUDIOIN%,Name,,"Analog Audio In"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_CAPTURE_VIDEOOUT%,Name,,"Video Out"
HKLM,%MediaCategories%\%IT_GUID_PINNAME_CAPTURE_AUDIOOUT%,Name,,"Audio Out"

[IT9910HD.Category.AddReg]
HKCR,%ActiveMovieCategories%\%KSCATEGORY_ENCODER%,CLSID,,%KSCATEGORY_ENCODER%
HKCR,%ActiveMovieCategories%\%KSCATEGORY_ENCODER%,FriendlyName,,%Category_Encoders%
HKCR,%ActiveMovieCategories%\%KSCATEGORY_MULTIPLEXER%,CLSID,,%KSCATEGORY_MULTIPLEXER%
HKCR,%ActiveMovieCategories%\%KSCATEGORY_MULTIPLEXER%,FriendlyName,,%Category_Multiplexers%


;Capture
[IT9910HD.Filter.Capture]
AddReg = IT9910HD.Filter.Capture.AddReg

[IT9910HD.Filter.Capture.Addreg]
HKR,,CLSID,,%CLSID.KSProxy%
HKR,,FriendlyName,,%IT9910HD.Filter.Capture.Desc%


;Eagle Rx
[IT9517BDA.Interfaces]
AddReg=IT9517BDA.Interface.AddReg

[IT9517BDA2.Interfaces]
AddReg=IT9517BDA2.Interface.AddReg

[IT9517BDA.Interface.AddReg]
HKR,,CLSID,,%IT9517BDA.CLSID%
HKR,,FriendlyName,,%IT9517BDA.FriendlyName%

[IT9517BDA2.Interface.AddReg]
HKR,,CLSID,,%IT9517BDA.CLSID%
HKR,,FriendlyName,,%IT9517BDA2.FriendlyName%

[Strings]
MfgName                   = "Hauppauge Computer Works"
IT9517BDA.CLSID           = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
IT9517BDA.Disc            = "HD PVR 60 Installation Disc"
IT9517BDA.Disc64          = "HD PVR 60 Installation Disc (64Bit Components)"
IT9517BDA.DiscWOW         = "HD PVR 60 Installation Disc (WOW64 Components)"
IT9517BDA.DeviceDesc      = "IT9517 GB Device (proto)"
hcwG4bda.DeviceDesc       = "HD PVR 60"
;IT9517Device.FriendlyName= "IT9517 GB Devices"
hcwG4bda.FriendlyName     = "Hauppauge HD PVR 60"
IT9517BDA.FriendlyName    = "IT9517 BDA Filter"
IT9517BDA2.FriendlyName   = "IT9517 BDA Filter"
IT9910HD.Filter.TVTuner.Desc = "HD PVR 60 TV Tuner Filter (HD)"
IT9910HD.Filter.Capture.Desc = "HD PVR 60 Capture Filter (HD)"
IT9910HD.Filter.XBar.Desc    = "HD PVR 60 Crossbar Filter (HD)"
IT9910HD.Filter.Encoder.Desc = "HD PVR 60 Encoder Filter (HD)"
KSNAME_Filter           = "{CACACEFD-1B5F-49f4-AF24-0CE559CC1E6D}"
KSNAME_Filter2          = "{CACACEFD-1B5F-49f4-AF24-0CE559CC1E6E}"
; xbar
IT_GUID_XBAR            = "{99103000-A330-11E1-A380-991068640000}"
; capture
IT_GUID_CAPTURE                         = "{99104000-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_CAPTURE_VIDEOIN         = "{99104080-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_CAPTURE_AUDIOIN         = "{99104081-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_CAPTURE_VIDEOOUT        = "{991040C0-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_CAPTURE_AUDIOOUT        = "{991040C1-A330-11E1-A380-991068640000}"
; encoder
IT_GUID_ENCODER                         = "{99105000-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_ENCODER_VIDEOIN         = "{99105080-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_ENCODER_AUDIOIN         = "{99105081-A330-11E1-A380-991068640000}"
Plugin_BdaDevice        = "BDA Device Control Plug-in"
GUID.TunerCatID         = "{71985F48-1CA1-11d3-9CC8-00C04F7971E0}"
AMcatID                 = "{DA4E3DA0-D07D-11d0-BD50-00A0C911CE86}"
BDAReceivers            = "BDA Streaming Receiver Components"
MediaCategories         = "SYSTEM\CurrentControlSet\Control\MediaCategories"
ActiveMovieCategories   = "CLSID\{da4e3da0-d07d-11d0-bd50-00a0c911ce86}\Instance"
Category_Encoders       = "WDM Streaming Encoder Devices"
Category_Multiplexers   = "WDM Streaming Multiplexer Devices"
Pin.BdaTransport        = "BDA Transport Stream"
GUID.BdaTransport       = "{78216A81-CFA8-493e-9711-36A61C08BD9D}"
GUID.BdaReceiverCtrl    = "{FD0A5AF3-B41D-11d2-9C95-00C04F7971E0}"


; ServiceType values
SERVICE_KERNEL_DRIVER       = 0x00000001
SERVICE_FILE_SYSTEM_DRIVER  = 0x00000002
SERVICE_ADAPTER             = 0x00000004
SERVICE_RECOGNIZER_DRIVER   = 0x00000008
SERVICE_WIN32_OWN_PROCESS   = 0x00000010
SERVICE_WIN32_SHARE_PROCESS = 0x00000020
SERVICE_INTERACTIVE_PROCESS = 0x00000100
SERVICE_INTERACTIVE_SHARE_PROCESS = 0x00000120

; StartType values
SERVICE_BOOT_START          = 0x00000000
SERVICE_SYSTEM_START        = 0x00000001
SERVICE_AUTO_START          = 0x00000002
SERVICE_DEMAND_START        = 0x00000003
SERVICE_DISABLED            = 0x00000004

; ErrorControl values
SERVICE_ERROR_IGNORE        = 0x00000000
SERVICE_ERROR_NORMAL        = 0x00000001
SERVICE_ERROR_SEVERE        = 0x00000002
SERVICE_ERROR_CRITICAL      = 0x00000003

; Registry types
REG_MULTI_SZ                = 0x10000
REG_EXPAND_SZ               = 0x20000
REG_DWORD                   = 0x10001

;avshws.Reader.FriendlyName="IT9517 TX Filter"
avshws.Reader.FriendlyName="HD PVR 60 Output Filter"
Proxy.CLSID="{17CCA71B-ECD7-11D0-B908-00A0C9223196}"

GUID_AIRHD_CAPTURE_FILTER = "{9963CC0E-EE70-11E0-BA8F-92D34824019B}"
KSCATEGORY_WDMSYS ="{FBF6F530-07B9-11D2-A71E-0000F8004788}"
KSCATEGORY_TVTUNER  = "{a799a800-a46d-11d0-a18c-00a02401dcd4}"
KSCATEGORY_CROSSBAR = "{a799a801-a46d-11d0-a18c-00a02401dcd4}"
KSCATEGORY_ENCODER  = "{19689BF6-C384-48FD-AD51-90E58C79F70B}"
KSCATEGORY_MULTIPLEXER = "{7A5DE1D3-01A1-452c-B481-4FA2B96271E8}"
KSCATEGORY_CAPTURE  = "{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
CLSID.KSXBar = "{71F96460-78F3-11d0-A18C-00A0C9118956}"
CLSID.KSProxy  = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
; tv tuner
IT_GUID_TVTUNER                         = "{99101000-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_TVTUNER_VIDEOOUT        = "{991010C0-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_TVTUNER_AUDIOOUT        = "{991010C1-A330-11E1-A380-991068640000}"
; tv audio
IT_GUID_TVAUDIO                         = "{99102000-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_TVAUDIOIN               = "{99102080-A330-11E1-A380-991068640000}"
IT_GUID_PINNAME_TVAUDIOOUT              = "{991020C0-A330-11E1-A380-991068640000}"
KSCATEGORY_VIDEO = "{6994AD05-93EF-11D0-A3CC-00A0C9223196}"