Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

103 lines
2.2 KiB

#include "pch.hxx"
#include "inpobj.h"
#include <shlguid.h>
// IInputObject helpers
HRESULT UnkHasFocusIO(IUnknown *punkThis)
{
HRESULT hres = E_FAIL;
if (punkThis != NULL)
{
IInputObject *pio;
hres = punkThis->QueryInterface(IID_IInputObject, (LPVOID*)&pio);
if (SUCCEEDED(hres))
{
hres = pio->HasFocusIO();
pio->Release();
}
}
return hres;
}
HRESULT UnkTranslateAcceleratorIO(IUnknown *punkThis, MSG* pmsg)
{
HRESULT hres = E_FAIL;
if (punkThis != NULL)
{
IInputObject *pio;
hres = punkThis->QueryInterface(IID_IInputObject, (LPVOID*)&pio);
if (SUCCEEDED(hres))
{
hres = pio->TranslateAcceleratorIO(pmsg);
pio->Release();
}
}
return hres;
}
HRESULT UnkUIActivateIO(IUnknown *punkThis, BOOL fActivate, LPMSG lpMsg)
{
HRESULT hres = E_FAIL;
if (punkThis != NULL)
{
IInputObject *pio;
hres = punkThis->QueryInterface(IID_IInputObject, (LPVOID*)&pio);
if (SUCCEEDED(hres))
{
hres = pio->UIActivateIO(fActivate, lpMsg);
pio->Release();
}
}
return hres;
}
// IInputObjectSite helpers
HRESULT UnkOnFocusChangeIS(IUnknown *punkThis, IUnknown *punkSrc, BOOL fSetFocus)
{
HRESULT hres = E_FAIL;
if (punkThis != NULL)
{
IInputObjectSite *pis;
hres = punkThis->QueryInterface(IID_IInputObjectSite, (LPVOID*)&pis);
if (SUCCEEDED(hres))
{
hres = pis->OnFocusChangeIS(punkSrc, fSetFocus);
pis->Release();
}
}
return hres;
}
// IObjectWithSite helpers
HRESULT UnkSetSite(IUnknown *punk, IUnknown *punkSite)
{
HRESULT hr = E_FAIL;
IObjectWithSite *pows;
Assert(punk);
if (punk) {
hr = punk->QueryInterface(IID_IObjectWithSite, (void**)&pows);
Assert(SUCCEEDED(hr));
if (SUCCEEDED(hr)) {
hr = pows->SetSite(punkSite);
Assert(SUCCEEDED(hr));
pows->Release();
}
}
return hr;
}