none
Win 10 universal driver sample code CustomSensors build error if configuration set to x64 from win32 RRS feed

  • Question

  • The sample code build successfully in win32 configuration.

    But when setting the configuration to x64,  the build reports " Warning C4311 'type cast': pointer truncation from 'SENSOROBJECT' to 'INT'" on several lines where WPP trace output, and build stopped  with  "Error C2220 warning treated as error - no 'object' file generated ".     How to deal with this,  is there something wrong with my setting ?

    Thanks,

    Johnson

    • Moved by Barry Wang Wednesday, December 2, 2015 3:33 AM Driver Development
    Tuesday, December 1, 2015 1:09 PM

Answers

  • Hello Johnson,

    Thank you for reporting this!
    There is indeed an issue with some of the tracing functions in the driver. The fix for this issue is to remove the casting and update the format specifier as illustrated below.

    From:
    TraceError("CSTM %!FUNC! Sensor(%08X) parameter is invalid. Failed %!STATUS!", (INT) SensorInstance, Status);

    To:
    TraceError
    ("CSTM %!FUNC! Sensor(%p) parameter is invalid. Failed %!STATUS!",SensorInstance, Status);

    Best regards,Jocelyn

    Friday, December 4, 2015 12:04 AM

All replies

  • Hello Johnson,

    I'll move this case to this forum https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=wdk I think this is the right forum for your issue.

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 2, 2015 3:32 AM
  • @Johnson,

    Wait. I may made a mistake. I will consult this case. Maybe I'm moving to the wrong forum.

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 2, 2015 3:35 AM
  • @Johnson,

    I'm not able to move it back and in my point of view maybe driver development forum may better. Anyway, what about report this project issue to here https://github.com/Microsoft/Windows-driver-samples/issues I think that is more reasonable.

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 2, 2015 5:50 AM
  • Hello Johnson,

    Thank you for reporting this!
    There is indeed an issue with some of the tracing functions in the driver. The fix for this issue is to remove the casting and update the format specifier as illustrated below.

    From:
    TraceError("CSTM %!FUNC! Sensor(%08X) parameter is invalid. Failed %!STATUS!", (INT) SensorInstance, Status);

    To:
    TraceError
    ("CSTM %!FUNC! Sensor(%p) parameter is invalid. Failed %!STATUS!",SensorInstance, Status);

    Best regards,Jocelyn

    Friday, December 4, 2015 12:04 AM