// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. #include "StdAfx.h" #include "AlarmContent.h" CAlarmContent::CAlarmContent() : m_nRef(0) { AddRef(); } CAlarmContent::~CAlarmContent() { } // // IUnknown methods // HRESULT CAlarmContent::QueryInterface( REFIID riid, LPVOID* ppvObject ) { if (IID_IUnknown == riid || IID_ISideShowContent == riid) { *ppvObject = this; AddRef(); return S_OK; } return E_NOINTERFACE; } ULONG CAlarmContent::AddRef() { return ::InterlockedIncrement(&m_nRef); } ULONG CAlarmContent::Release() { LONG nRef = ::InterlockedDecrement(&m_nRef); if (0 == nRef) { delete this; } return nRef; } // // ISideShowContent methods // HRESULT CAlarmContent::GetContent( ISideShowCapabilities* /*pICapabilities*/, DWORD* pdwSize, BYTE** ppbData) { HRESULT hr = S_OK; if (NULL == pdwSize || NULL == ppbData) { return E_INVALIDARG; } // // For now, just use static content to send to the device. // The string needs to be UTF-8. // char* szXML = "