Jump to content
  • Advertisement
Sign in to follow this  
GoodFun

[SlimDX] Using DirectX 10 in a Windows Service

This topic is 3646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heya, I have a pretty exotic question again for you guys... I'm trying to use DirectX 10 with SlimDX out of a Windows Service. I'm getting the following exception: {"DXGI_ERROR_NOT_FOUND: The item requested was not found. For GetPrivateData calls, this means that the specified GUID had not been previously associated with the object. (-2005270526)"} I don't seem to be getting a debug spew on this. The exception happens when I try to create the device...
_device = new D3D10.Device(D3D10.DeviceCreationFlags.Debug);
The service is running under Local System Account and 'Allow service to interact with desktop' is checked. I tried it without that box checked with the same result. My assumption is that DirectX is not available to a service, maybe one of you guys knows of a way to get around that. As for what my service does, it renders data into off screen textures and saves them to a memory stream. I'm not using a swap chain and hence no actual display. Things work fine when I use a Windows App, I was just hoping I could find a way to run this as a service to get around things like having to login to run the app or the app being closed by accident.

Share this post


Link to post
Share on other sites
Advertisement
Offhand, I seem to recall that services by default run in their own little login session without access to the adapter, so you should expect to get the same kind of failures that you'd get if you didn't have a monitor connected at all. That looks to be the case here.

You may try configuring your service differently -- under the "Log On" tab in the service properties (Control Panel -> Administrative Tools -> Services -> right-click a service and choose Properties) you can alter the account used to execute the service and, in what looks to be most promising, click a checkbox that controls if the service can interact with the desktop. You can also mess with the hardware profiles the service belongs to.

Since this is a general DirectX concern, you may also consider posting to the DIRECTXDEV mailing list if what I suggested doesn't work and nobody else chimes in with a reasonable solution or explanation about how and why you can't do this.

Share this post


Link to post
Share on other sites
It’s a know limitation of services that they can’t use Direct3D no matter how you configured them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!