I'm running 64-bit Windows Vista, and the crash only happens when compiling for 32-bit, while it all works fine when compiling for 64-bit. There is also no crash if using two level 9 D3D11 devices or two level 9 D3D10.1 devices.
Is there something I need to think about when creating multiple level 9 devices, or is this a bug?
I have a GeForce 8800 GT with the latest WHQL drivers, and the latest Windows updates. It doesn't crash on another system I tried it on with integrated graphics. Unfortunately I haven't been able to test it on another NVidia system.
This is a minimal example that crashes for me on pDevice11->Release().
#include <windows.h>#include <D3D11.h>#include <D3D10_1.h>#pragma comment (lib, "D3D11.lib")#pragma comment (lib, "D3D10_1.lib")// Mainint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // Create D3D11 device ID3D11Device *pDevice11; D3D_FEATURE_LEVEL featureLevel = D3D_FEATURE_LEVEL_9_1; HRESULT hResult = D3D11CreateDevice( NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1, D3D11_SDK_VERSION, &pDevice11, NULL, NULL ); if(FAILED(hResult)) { MessageBox(NULL, TEXT("D3D11CreateDevice"), TEXT("Error"), MB_OK); } else { // D3D10.1 device ID3D10Device1 *pDevice10; hResult = D3D10CreateDevice1( NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_FEATURE_LEVEL_9_1, D3D10_1_SDK_VERSION, &pDevice10 ); if(FAILED(hResult)) { MessageBox(NULL, TEXT("D3D10CreateDevice1"), TEXT("Error"), MB_OK); } else { pDevice10->Release(); } pDevice11->Release(); } MessageBox(NULL, TEXT("Complete!"), TEXT("Message"), MB_OK); return 0;}
EDIT: And here's the call stack: