locked
Banned APIs used in generated files

    Question

  • Hello,

    I'm using 'banned.h' in my project to weed out the Banned APIs so that I'm able to upload my app to the store when the time comes, however I'm getting errors from banned.h.

    c:\program files (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(281): error C4995: 'memcpy': name was marked as #pragma deprecated (Generated Files\XamlTypeInfo.Impl.g.cpp)
    c:\program files (x86)\microsoft visual studio 11.0\vc\include\xlocmon(179): error C4995: 'memcpy': name was marked as #pragma deprecated (Generated Files\XamlTypeInfo.Impl.g.cpp)
    c:\program files (x86)\microsoft visual studio 11.0\vc\include\xlocmon(180): error C4995: 'memcpy': name was marked as #pragma deprecated (Generated Files\XamlTypeInfo.Impl.g.cpp)

    The three errors above are the errors I'm receiving and as you can see they are in XamlTypeInfo.g.cpp. I know we aren't supposed to touch these files so I was wondering if someone could help me understand better how these files are generated.

    Any help on this issue would be appreciated.

    Tuesday, September 4, 2012 6:51 PM

All replies

  • Hi.

    I cannot reproduce your issue. I included the banned.h to my project and build it successfully.

    Would you please provide us more detail steps to reproduce this issue?

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, September 5, 2012 4:42 AM
  • I know why the issue is happening, it's because I'm using some deprecated functions in my code that are banned APIs (memcpy in this case). However, I'm not calling these functions in my code. They are being called from the files 'xlocbuf' and 'xlocmon'. These files are being referenced somewhere in 'XamlTypeInfo.Impl.g.cpp' I think because that's what the errors are telling me.

    I do not create XamlTypeInfo, it's generated from the compiler, and I'm told in documentation (Seen Here) not to touch the XamlInfoType files.

    Now my question is mainly, how do these files get generated? I can't find any information and I have a feeling that it's something in my XAML files causing it to include these functions. If that solution can't be found, does anyone know how to bypass these errors? Or has anyone seen them before?

    Thanks!

    Wednesday, September 5, 2012 1:54 PM