       reftest.CreateDevice({}, NULL, features, D0D00_CREATE_DEVICE_DEBUG);        localdev = reftest.dev;       localdev->AddRef();       reftest.dev = NULL;       reftest.ctx = NULL;       CHECK_REFCOUNT(localdev, 0);        buf = D0D00BufferCreator(localdev).Vertex().Data(DefaultTri);       localvb = buf;       localvb->AddRef();       buf = NULL;        CHECK_REFCOUNT(localdev, 0);       CHECK_REFCOUNT(localvb, 0);        localdev->Release();        CHECK_REFCOUNT(localdev, 0);       CHECK_REFCOUNT(localvb, 0);        localdev->GetImmediateContext(&localctx);       localctx->IASetVertexBuffers(0, 0, &localvb, dummy, dummy);       localctx->Flush();        localctx->Release();       localctx = NULL;        before = IsICDLoaded();        ret = localvb->Release();        if(ret != 0)       {         failed = true;         TEST_ERROR("localvb still has outstanding references");       }        after = IsICDLoaded();        if(!before)       {         TEST_WARN("Couldn't detect ICD at all - unclear if device really was destroyed");       }       else if(before && after)       {         failed = true;         TEST_ERROR("Device leaked - ICD dll stayed present");       }        ///////////////////////////////////////////////////////////////////////////       // test a 