Jul 23 2009

Unsuccessfully Attempting to Identify the DirectDraw Driver

In my experience identifying the DirectDraw driver on the device is difficult to impossible.  According to documentation the IDIRECTDRAW::GetDeviceIdentifier method should be used to retrieve the driver information.  At the time that I am writing this the Windows Mobile 6 documentation shows that this method has one parameter of type  LPDDDEVICEIDENTIFIER.  But when you try to use the method you’ll find there is a second parameter needed of type DWORD.  When I first came across this I was a little confused because there was no mention of it in the documentation.  But I finally came across documentation for Windows CE 3.0 that mentioned the second parameter as being a flag and DDGDI_GETHOSTIDENTIFIER was the only possible value.  I tried to use the flag but then I found that it wasn’t defined in my header file.  After a bit of searching on the Internet I found this flag has a value of one.  I added a conditional #define to my source code.  It is conditional so that if I ever do get a correct header file it won’t break my code with redundant definitions.

#ifndef DDGDI_GETHOSTIDENTIFIER
#define DDGDI_GETHOSTIDENTIFIER 0x00000001L
#endif

I ran my code an error informing me that the argument was invalid.  I considered the possibility that 1 wasn’t the correct value. So I tried calling the function in a for loop testing out all possible values.  For the value of 0 I received  E_NOTIMPL. For all other values I received E_INVALIDARG.  As a final test I ran this against an emulator image with identical results.  So as far as I am concerned this method cannot be called in confidence.

Tags: