Skip to content

Commit

Permalink
Aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
SyncIt21 committed Aug 8, 2023
1 parent 0b7b5ea commit 5448041
Show file tree
Hide file tree
Showing 3 changed files with 276 additions and 83 deletions.
13 changes: 9 additions & 4 deletions SampleInterfaces/TestIPCFactoryBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@ HRESULT __stdcall ComputerIPSFactoryBuffer::CreateProxy(
void** ppv //We must give this a value. the actual interface specified by IID returned to the client
)
{
IUnknown* mainObject = NULL;

HRESULT hr;
if (riid == IID_IMOUSE)
*ppProxy = new MouseProxyBuffer(pUnkOuter);
hr = MouseProxyBufferNonDelegate::Create(pUnkOuter, IID_IUnknown, (void**)&mainObject);
else if (riid == IID_IKEYBOARD)
*ppProxy = new KeyboardProxyBuffer(pUnkOuter);
hr = KeyboardProxyBufferNonDelegate::Create(pUnkOuter, IID_IUnknown, (void**)&mainObject);
else
{
*ppv = NULL;
*ppProxy = NULL;
return E_NOINTERFACE;
}
if (FAILED(hr))
return E_UNEXPECTED;

((IUnknown*)*ppProxy)->QueryInterface(riid, (void**)ppv);
((IUnknown*)mainObject)->QueryInterface(riid, (void**)ppv);

return ((IUnknown*)*ppProxy)->QueryInterface(IID_IRpcProxyBuffer, (void**)ppProxy);
return ((IUnknown*)mainObject)->QueryInterface(IID_IRpcProxyBuffer, (void**)ppProxy);
}

//Server side
Expand Down
Loading

0 comments on commit 5448041

Please sign in to comment.