Occlusion Queries in managed DirectX

I'm currently using occlusion queries to increase performance in a simulation engine that I am writing in managed DirectX. I have the occlusion query infrastructure built into my engine, but I do not know how to check to see if the device actually supports hardware occlusion queries or not. In the DirectX C++ documentation they say the following:
Before you create a query, you can check to see if the runtime supports queries by calling IDirect3DDevice9::CreateQuery with a NULL pointer like this:


IDirect3DQuery9* pEventQuery;
// Create a device pointer m_pd3dDevice
// Create a query object
HRESULT hr = m_pd3dDevice->CreateQuery(D3DQUERYTYPE_EVENT, NULL);

However, in Managed DirectX, there is no comparable method to call. The only way to create a query is to create a new Query object like the following:
Query q = new Query(device, QueryType.Event);
Will this throw an exception if the device does not support the query, or is there another way to do this? I've been searching for quite some time to find somewhere that says how to check if a device supports a query in managed DirectX, but I haven't had any luck yet. Thanks for your help.

[1506 byte] By [MattWyckhouse] at [2008-2-15]
# 1
I would put the code in try/end try tags.
dim isHwOcclusions as boolean
try
Query q = new Query(device, QueryType.Event);
isHwOcclusions =true
catch ex as exeption
isHwOcclusions =false
end try
sorry for the vb code. I haven't done managed C++ yet, but i assume they have try catch there too :)
Dustin_H at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
While there is no current way to do this (aside from catching the exception), the upcoming Whidbey MDX assembly will have a much cleaner way of determining this.
TomMiller at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3
Thanks for the responses. Just to clarify, will there be an exception thrown in the contructor if the query is not supported?
MattWyckhouse at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...