Is it possible to get the caller's PID from a COM Interface?

Hello, I was wondering if there is any way to retrieve the id of a process calling a method of a COM object from the code of such method. For instance, let's say we have a COM interface derived from IUnknown as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class MyComInterface : public IUnknown
{

HRESULT __stdcall QueryInterface (REFIID iid, void ** ppvObject);
ULONG __stdcall AddRef (void);
ULONG __stdcall Release (void);

MyComInterface ();
~MyComInterface();
};

...

HRESULT __stdcall MyComInterface::QueryInterface (REFIID iid, void ** ppvObject)
{
...
// Can I get the PID of the process who called 'MyComInterface::QueryInterface' from here?
return S_OK
}


I'm not really sure this can be done, but if there was a way my life would be much easier at this moment

Thanks in advance.
If it's not inprocess, no.
Topic archived. No new replies allowed.