As SP 24 suggested, you should check the error code using
GetLastError()
. Judging by what you said it could be
ERROR_IN_WOW64
. See the MSDN documentation on
UpdateDriverForPlugAndPlayDevices
ERROR_IN_WOW64: The calling application is a 32-bit application attempting to execute in a 64-bit environment, which is not allowed.
If this is it, make sure your installer is being built as a 64 bit application.