• Advertisement
Sign in to follow this  

::D3D10CreateDeviceAndSwapChain() causes “Invalid parameter passed to C runtime function.” Spam.

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

My research shows this could just be a driver bug, but if possible I would like to alleviate it, as I don’t like spam.

My code:


DXGI_SWAP_CHAIN_DESC dscdSwapChain = { 0 };
dscdSwapChain.BufferCount = 1UL;
dscdSwapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
dscdSwapChain.BufferDesc.Width = rClient.right - rClient.left;
dscdSwapChain.BufferDesc.Height = rClient.bottom - rClient.top;
dscdSwapChain.BufferDesc.RefreshRate.Numerator = 0UL;
dscdSwapChain.BufferDesc.RefreshRate.Denominator = 0UL;
dscdSwapChain.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
dscdSwapChain.OutputWindow = _lpdiInit->hWnd;
dscdSwapChain.SampleDesc.Count = 1UL;
dscdSwapChain.SampleDesc.Quality = 0UL;
dscdSwapChain.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
dscdSwapChain.Windowed = _lpdiInit->bWindowed;

static const D3D10_DRIVER_TYPE dtDrivers[] = {
D3D10_DRIVER_TYPE_SOFTWARE,
D3D10_DRIVER_TYPE_HARDWARE,
};

for ( LSUINT32 I = LSE_ELEMENTS( dtDrivers ); I--; ) {
if ( SUCCEEDED( ::D3D10CreateDeviceAndSwapChain( NULL, dtDrivers,
NULL, 0UL, D3D10_SDK_VERSION,
&dscdSwapChain,
&m_pscSwapChain, &m_pdDevice ) ) ) {
m_dtDriver = dtDrivers;
break;
}
}



  1. It was over a year ago that I last ran this code (finally decided to start getting my DirectX 10 and DirectX 11 sides of my engine caught up) but I know for sure this error did not happen then (same hardware).
  2. This code has not changed since then, but I have updated my drivers many times since then.
  3. It still succeeds even after all the spam egg sausage and spam.

I am sure it is a driver bug, but is there any known way around it? My drivers are fully up-to-date so updating them is not an option, and besides I don’t want this to happen on any hardware once my engine is release.


L. Spiro

Share this post


Link to post
Share on other sites
Advertisement
Possible that your BufferDesc members don't match to an enumerated mode - Microsoft recommend that they do if you're creating a full-screen device (can't find a doc ref link for this right now). I just memcpy a DXGI_MODE_DESC for the mode I'm starting up in over to these rather than setting them up by hand.

I'm also fairly positive that your BufferCount should be 2 for D3D10 and 11 - the documentation notes that this member is "the number of buffers in the swap chain, including the front buffer" and the DXUT source code creates it with 2 as well.

Share this post


Link to post
Share on other sites
Yes, it would be a bug.
I had the same problem in my Vaio, because of outdated drivers.
Please, post whole console log.

Share this post


Link to post
Share on other sites
From where do you copy the DXGI_MODE_DESC structure? How do you get the reference copy?

BufferCount is the same in OpenGL and DirectX 9 as well, and I am using 1 for all of them. At least for now I am stuck with 1 in DirectX 10, though I probably will switch to 2 later. Also I am in windowed mode.


L. Spiro

Share this post


Link to post
Share on other sites

Please, post whole console log.



[spoiler]
[quote name='Debug Console']'LSTest.exe': Loaded 'C:\Windows\SysWOW64\aticfx32.dll', No symbols loaded.
'LSTest.exe': Loaded 'C:\Windows\SysWOW64\atiuxpag.dll', No symbols loaded.
'LSTest.exe': Loaded 'C:\Windows\SysWOW64\atidxx32.dll', No symbols loaded.
DXX32: Warn: Registry value too long: MainVideo_SET in SYSTEM\ControlSet001\Control\CLASS\{4D36E968-E325-11CE-BFC1-08002BE10318}\0001\UMD
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
DXX32: Warn: Registry value too long: MainVideo_SET in SYSTEM\ControlSet001\Control\CLASS\{4D36E968-E325-11CE-BFC1-08002BE10318}\0001\UMD
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
The thread 'Win32 Thread' (0x5c8) has exited with code 0 (0x0).[/quote][/spoiler]


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
Maybe you would try executing your app in various hardware configurations.
It is logged close to ATI libs.
Probably after loading them.
In my opinion it is not your fault.

Share this post


Link to post
Share on other sites

From where do you copy the DXGI_MODE_DESC structure? How do you get the reference copy?

I take it from EnumAdapters/EnumOutputs/GetDisplayModeList, then run through FindClosestMatchingMode if I have any desired startup params.

Share this post


Link to post
Share on other sites
I'm having the exact same problems for a while now, haven't been able to find a solution to date.
I'm also seeing seemingly random driver crashes for code that has worked perfectly in the past. I'm still figuring out whether I did something stupid somewhere, but I'm starting to suspect a driver bug.

Share this post


Link to post
Share on other sites
I upgraded to the 12.4 (latest) AMD drivers and started seeing this problem too. Pretty much the exact same warnings you see, including the "[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(247, 247, 247)] Registry value too long" message.[/background]

[/font]

Share this post


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

  • Advertisement