views:

126

answers:

0

One of our products is a screensaver that plays movies using DirectShow. In XP this screensaver works when no one is logged in. In Vista no movies are played when no one is logged in. The reason is that "CoCreateInstance" fails with error code 0x80070005 (= "Access Is Denied").

This is the code we use to initialize DirectShow:

HRESULT hr = NULL;
IGraphBuilder* pIGraphBuilder = 0;
hr = CoInitialize(0);
hr = CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC, __uuidof(pIGraphBuilder), reinterpret_cast<void**>(&pIGraphBuilder));

The difference between XP and Vista is that when no one is logged in, in XP the screensaver starts as "System Account" and in Vista as "Local Service". "Local Service" has less privileges and obviously this is the reason why we get "Access Denied".

My question to you is: Is there a way to get more privileges so DirectShow can be initialized properly?