locked
CreateEventEx & CreateSemaphoreEx fail to pass metro certification, bug in certification tool?

    Question

  • Hello all, 

    I've tried to certify my (release+debug info) exe+dll sample and got 2 only following errors

    Error: This application failed the supported API check.

    • API CreateEventExA in kernel32.dll is not supported for this application type. my.dll calls this API.
    • API CreateSemaphoreExA in kernel32.dll is not supported for this application type. my.dll calls this API. 

    MSDN tells that both functions "Applies to: desktop apps | Metro style apps"

    Any hints what is wrong: documentation or the tool?

    Thanks!
    --Vladimir

    Friday, March 23, 2012 2:05 PM

Answers

  • If you look at the list of allowed Win32 API in Win32 and COM for Metro style apps (system) you will see that CreateEventExW is allowed but CreateEventExA is not. You can also look at the header files to see if a given API is in the Desktop family or the Application family. See Win32 and COM for Metro style apps for details on how to do this.

    The individual documentation pages unfortunately don't go into that level of detail. Thank you for pointing out that this causes confusion.

    The general recommendation is to use Unicode for all new apps. I didn't do an exhaustive search, but I wouldn't expect any ANSI functions to be allowed for Metro style apps. Functions like InitializeCriticalSectionEx which don't have string parameters do not have separate A and W versions.

    --Rob

    Friday, March 23, 2012 7:38 PM
    Owner
  • Hi Vladimir,

    is it possible to use the unicode version of the APIs in my.dll instead i.e. CreateEventExW and CreateSemaphoreExW?

    I believe the tool is correct and the documentation needs to be clearer that the unicode versions should be used in Metro apps.  I will double check.

    thanks!

    mike

    Friday, March 23, 2012 5:07 PM
    Moderator

All replies

  • Hi Vladimir,

    is it possible to use the unicode version of the APIs in my.dll instead i.e. CreateEventExW and CreateSemaphoreExW?

    I believe the tool is correct and the documentation needs to be clearer that the unicode versions should be used in Metro apps.  I will double check.

    thanks!

    mike

    Friday, March 23, 2012 5:07 PM
    Moderator
  • Thanks Mike, now it is passed!

    But it would be good to see your 'double checked' opinion:)

    because I have a lot non-unicode calls like InitializeCriticalSectionEx that passed the check

    --Vladimir

    Friday, March 23, 2012 5:57 PM
  • If you look at the list of allowed Win32 API in Win32 and COM for Metro style apps (system) you will see that CreateEventExW is allowed but CreateEventExA is not. You can also look at the header files to see if a given API is in the Desktop family or the Application family. See Win32 and COM for Metro style apps for details on how to do this.

    The individual documentation pages unfortunately don't go into that level of detail. Thank you for pointing out that this causes confusion.

    The general recommendation is to use Unicode for all new apps. I didn't do an exhaustive search, but I wouldn't expect any ANSI functions to be allowed for Metro style apps. Functions like InitializeCriticalSectionEx which don't have string parameters do not have separate A and W versions.

    --Rob

    Friday, March 23, 2012 7:38 PM
    Owner