Jump to content
  • Advertisement
Sign in to follow this  
Whocares45

DX11 Non-fatal, undocumented return code

This topic is 413 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

Hi guys, I was wondering if any of you ever had an encounter with 0xCCCCCCCC as a return code/result when calling a D3D11CreateDeviceAndSwapChain or D3D11CreateDevice.

My code worked just fine as of yesterday, and did for months, but I now get 0xCCCCCCCC instead of the usual S_OK (or rarely S_FALSE) for some reason. Literally nothing in my code changed. I woke up to that return code. Whatever it is, it's in no way preventing my application from working as it should but I do have to bypass the error checking I've put in place because of how unusual the error code is.

Can anyone shed some light on this undocumented return code?

Edited by Shangbye

Share this post


Link to post
Share on other sites
Advertisement

Now that you mention it, it does look like it. The value is just plain off when I take a look at the range of the documented values.

I'll try replacing D3D11.dll and see if it changes anything. Thanks dude.

Edited by Shangbye

Share this post


Link to post
Share on other sites

You're spot on about the origin of the value. I found out about it by monitoring the value before and after the call and then I discovered that the call didn't write to the HRESULT at all so it kept 0xCCCCCCCC as its value and my error detection failed. The corruption hypothesis turned out to be correct because I had no such problem when debugging the code on my other computer. Everything makes sense to me now because it seems my Win10 installation is partly corrupted. CL.EXE and C2.DLL started giving me weird errors 2 days ago and CL.EXE eventually wouldn't run at all. I replaced them with the files from the VS installation and it fixed the issue. I guess the same thing happened to d3d11.dll. Repairing my Win10 installation should take care of it. I should have come to that conclusion sooner tbh.

Edited by Shangbye

Share this post


Link to post
Share on other sites
12 minutes ago, Shangbye said:

it seems my Win10 installation is partly corrupted. CL.EXE and C2.DLL started giving me weird errors 2 days ago and CL.EXE eventually wouldn't run at all. I replaced them with the files from the VS installation and it fixed the issue

Your HDD/SSD is failing and/or you've got a virus attacking your PC :o

Time to pull your drives out and put in a clean one.

Share this post


Link to post
Share on other sites

Outside of failing hdd/virus, your other computer assumption is absurd.

 

Undefined behavior is undefined, you could have run fine for monh then crash, cure the cancer, resolve climate change or start world war 3. Undefined behavior means everything possible.

 

In regards to uninitialized variable, usually they either get set to 0xcccc or 0 if you run a debug runtime or contains whatever was at the address if not. And you cannot rely on it to be consistent between machines or os version !

Share this post


Link to post
Share on other sites
On 8/29/2017 at 10:08 PM, galop1n said:

In regards to uninitialized variable, usually they either get set to 0xcccc or 0

What is the idea behind using 0xCCCCCCCC? I think VS uses 0.

Share this post


Link to post
Share on other sites

No, all this magic numbers are Microsof, VS sure don't set memory to zero !, you can find a good list of theme here (https://stackoverflow.com/questions/127386/in-visual-studio-c-what-are-the-memory-allocation-representations). They are meant to help you debug, and be glad it gives consistent behavior to something that is not, because it allow you to catch bugs that could be silent for months. Your worst enemy would be everything initialized to 0.

Share this post


Link to post
Share on other sites
22 hours ago, galop1n said:

VS sure don't set memory to zero

Doesn't the MVSC++ compiler with debug flag enabled need to generate the explicit initialization code statements? (for me VS and MVSC++ are so coupled, pretty much the same; some skin over the compiler).

Edited by matt77hias

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!