Search code examples
visual-c++ipv6dcom

calling CoCreateInstanceEx with ipv6


I'm trying to call CoCreateInstanceEx by passing an ipv6 address, but it fails with access denied. Is there a way around this, or is it not supported? Here is a snipet:

       COSERVERINFO serverinfo;
        ZeroMemory( &serverinfo, sizeof serverinfo);
        serverinfo.pwszName = (OLECHAR *)sAddress.c_str();
        MULTI_QI qi[2];
        qi[0].pIID = &IID_IUnknown;
        qi[0].pItf = NULL;
        qi[0].hr = S_OK;
        qi[1].pIID = &IID_IXSMyIniitialize;
        qi[1].pItf = NULL;
        qi[1].hr = S_OK;
        HRESULT hr = CoCreateInstanceEx( 
            CLSID_CoSMyCOM, 
            0, 
            CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
            &serverinfo,
            2,
            qi);

If sAddress is something like 10.7.10.10, it works. But, if it is something like fe90::a877:d1aa:43f7:5922 I get access denied. Both addresses point to the same server. Thanks.


Solution

  • Please see my comment above, it was the zone index that I was missing.