mirror of
https://github.com/debauchee/barrier.git
synced 2025-07-21 18:38:04 +02:00
- Added data handler shell extension project (synwinxt) which will output a dll file.
- Removed misused comments in CServerProxy
This commit is contained in:
parent
a25587c4c5
commit
587c320f61
10 changed files with 562 additions and 9 deletions
77
src/lib/synwinxt/CDataHandlerExtension.cpp
Normal file
77
src/lib/synwinxt/CDataHandlerExtension.cpp
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2013 Bolton Software Ltd.
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file COPYING that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CDataHandlerExtension.h"
|
||||
#include <Shlwapi.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
extern LONG g_refCount;
|
||||
extern GUID g_CLSID;
|
||||
extern void outputDebugStringF(const char *str, ...);
|
||||
|
||||
CDataHandlerExtension::CDataHandlerExtension()
|
||||
{
|
||||
InterlockedIncrement(&g_refCount);
|
||||
}
|
||||
|
||||
CDataHandlerExtension::~CDataHandlerExtension()
|
||||
{
|
||||
InterlockedDecrement(&g_refCount);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
CDataHandlerExtension::QueryInterface(REFIID riid, void **ppvObject)
|
||||
{
|
||||
static const QITAB qit[] =
|
||||
{
|
||||
QITABENT(CDataHandlerExtension, IPersistFile),
|
||||
QITABENT(CDataHandlerExtension, IDataObject),
|
||||
{ 0 },
|
||||
};
|
||||
return QISearch(this, qit, riid, ppvObject);
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
CDataHandlerExtension::AddRef()
|
||||
{
|
||||
return InterlockedIncrement(&m_refCount);
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
CDataHandlerExtension::Release()
|
||||
{
|
||||
LONG count = InterlockedDecrement(&m_refCount);
|
||||
if (count == 0) {
|
||||
delete this;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
CDataHandlerExtension::Load(__RPC__in LPCOLESTR pszFileName, DWORD dwMode)
|
||||
{
|
||||
StringCchCopyW(m_selectedFileName, ARRAYSIZE(m_selectedFileName), pszFileName);
|
||||
outputDebugStringF("DataHandlerDemo: CDataHandlerExtension::Load: m_selectedFileName=%ls", m_selectedFileName);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
CDataHandlerExtension::GetClassID(__RPC__out CLSID *pClassID)
|
||||
{
|
||||
*pClassID = g_CLSID;
|
||||
return S_OK;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue