ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

lnbinfo.cpp
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:       See COPYING in the top level directory
00003  * PROJECT:         ReactOS BDA Proxy
00004  * FILE:            dll/directx/bdaplgin/lnbinfo.cpp
00005  * PURPOSE:         IBDA_LNBInfo interface
00006  *
00007  * PROGRAMMERS:     Johannes Anderwald (janderwald@reactos.org)
00008  */
00009 
00010 #include "precomp.h"
00011 
00012 #ifndef _MSC_VER
00013 const GUID IID_IBDA_LNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64,  0xc4, 0xf2, 0x3e, 0x24, 0x08, 0xf4}};
00014 const GUID KSPROPSETID_BdaLNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4}};
00015 #endif
00016 
00017 class CBDALNBInfo : public IBDA_LNBInfo
00018 {
00019 public:
00020     STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
00021 
00022     STDMETHODIMP_(ULONG) AddRef()
00023     {
00024         InterlockedIncrement(&m_Ref);
00025         return m_Ref;
00026     }
00027     STDMETHODIMP_(ULONG) Release()
00028     {
00029         InterlockedDecrement(&m_Ref);
00030         if (!m_Ref)
00031         {
00032             delete this;
00033             return 0;
00034         }
00035         return m_Ref;
00036     }
00037 
00038     //IBDA_LNBInfo methods
00039     HRESULT STDMETHODCALLTYPE put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow);
00040     HRESULT STDMETHODCALLTYPE get_LocalOscilatorFrequencyLowBand(ULONG *pulLOFLow);
00041     HRESULT STDMETHODCALLTYPE put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh);
00042     HRESULT STDMETHODCALLTYPE get_LocalOscilatorFrequencyHighBand(ULONG *pulLOFHigh);
00043     HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency);
00044     HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency);
00045 
00046     CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
00047     ~CBDALNBInfo(){};
00048 
00049 protected:
00050     LONG m_Ref;
00051     IKsPropertySet * m_pProperty;
00052     ULONG m_NodeId;
00053 };
00054 
00055 HRESULT
00056 STDMETHODCALLTYPE
00057 CBDALNBInfo::QueryInterface(
00058     IN  REFIID refiid,
00059     OUT PVOID* Output)
00060 {
00061     *Output = NULL;
00062 
00063     if (IsEqualGUID(refiid, IID_IUnknown))
00064     {
00065         *Output = PVOID(this);
00066         reinterpret_cast<IUnknown*>(*Output)->AddRef();
00067         return NOERROR;
00068     }
00069 
00070     if (IsEqualGUID(refiid, IID_IBDA_LNBInfo))
00071     {
00072         *Output = (IBDA_LNBInfo*)(this);
00073         reinterpret_cast<IBDA_LNBInfo*>(*Output)->AddRef();
00074         return NOERROR;
00075     }
00076 
00077 #ifdef BDAPLGIN_TRACE
00078     WCHAR Buffer[100];
00079     LPOLESTR lpstr;
00080     StringFromCLSID(refiid, &lpstr);
00081     swprintf(Buffer, L"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr);
00082     OutputDebugStringW(Buffer);
00083     CoTaskMemFree(lpstr);
00084 #endif
00085 
00086     return E_NOINTERFACE;
00087 }
00088 
00089 HRESULT
00090 STDMETHODCALLTYPE
00091 CBDALNBInfo::put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow)
00092 {
00093     KSP_NODE Node;
00094     HRESULT hr;
00095 
00096     // setup request
00097     Node.NodeId = m_NodeId;
00098     Node.Reserved = 0;
00099 
00100     // perform request
00101     hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_LOW_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFLow, sizeof(LONG));
00102 
00103 #ifdef BDAPLGIN_TRACE
00104     WCHAR Buffer[100];
00105     swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr);
00106     OutputDebugStringW(Buffer);
00107 #endif
00108 
00109     return hr;
00110 }
00111 
00112 HRESULT
00113 STDMETHODCALLTYPE
00114 CBDALNBInfo::get_LocalOscilatorFrequencyLowBand(ULONG *pulLOFLow)
00115 {
00116     return E_NOINTERFACE;
00117 }
00118 
00119 HRESULT
00120 STDMETHODCALLTYPE
00121 CBDALNBInfo::put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh)
00122 {
00123     KSP_NODE Node;
00124     HRESULT hr;
00125 
00126     // setup request
00127     Node.NodeId = m_NodeId;
00128     Node.Reserved = 0;
00129 
00130     // perform request
00131     hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_HIGH_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFHigh, sizeof(ULONG));
00132 
00133 #ifdef BDAPLGIN_TRACE
00134     WCHAR Buffer[100];
00135     swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr);
00136     OutputDebugStringW(Buffer);
00137 #endif
00138 
00139     return hr;
00140 }
00141 
00142 HRESULT
00143 STDMETHODCALLTYPE
00144 CBDALNBInfo::get_LocalOscilatorFrequencyHighBand(ULONG *pulLOFHigh)
00145 {
00146     return E_NOINTERFACE;
00147 }
00148 
00149 HRESULT
00150 STDMETHODCALLTYPE
00151 CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
00152 {
00153     KSP_NODE Node;
00154     HRESULT hr;
00155 
00156     // setup request
00157     Node.NodeId = m_NodeId;
00158     Node.Reserved = 0;
00159 
00160     // perform request
00161     hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulSwitchFrequency, sizeof(ULONG));
00162 
00163 #ifdef BDAPLGIN_TRACE
00164     WCHAR Buffer[100];
00165     swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr);
00166     OutputDebugStringW(Buffer);
00167 #endif
00168 
00169     return hr;
00170 }
00171 
00172 HRESULT
00173 STDMETHODCALLTYPE
00174 CBDALNBInfo::get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
00175 {
00176     return E_NOINTERFACE;
00177 }
00178 
00179 HRESULT
00180 WINAPI
00181 CBDALNBInfo_fnConstructor(
00182     IKsPropertySet *pProperty,
00183     ULONG NodeId,
00184     REFIID riid,
00185     LPVOID * ppv)
00186 {
00187     // construct device control
00188     CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
00189 
00190 #ifdef BDAPLGIN_TRACE
00191     OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");
00192 #endif
00193 
00194     if (!handler)
00195         return E_OUTOFMEMORY;
00196 
00197     if (FAILED(handler->QueryInterface(riid, ppv)))
00198     {
00199         /* not supported */
00200         delete handler;
00201         return E_NOINTERFACE;
00202     }
00203 
00204     return NOERROR;
00205 }

Generated on Sat May 26 2012 04:19:49 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.