locked
Win32 DLL with one exported function linked to Metro App - Fails Certification

    Question

  • Following is the configuration:

    - A minimal Win32 DLL with one function, practically empty, not using any WIn32 API.

    - Linked against Dev11 SDK.

    - Both App and DLL are release builds.

    - Metro App only packages this DLL, does not even call the function from DLL.

    - If DLL not packaged, certification passes.

    - Builds and runs successfully with DLL packaged.

    However fails the certification. Failure report lists restricted API used, same list as when certifing the *debug* build metro app.

    App is build in VS11 IDE - release build.

    DLL is built on cmd. line - release build:

    Cmd Line options used:

    Compiler:

    cl  src\api_dll.cpp /c /D "_USRDLL" /D "WIN32" /D "_WINDLL" /I"c:\pracs\metro\api_dll\src" %winhdrs% %vchdrs% /I"Release\" /EHsc /nologo /W1 /WX- /Oy- /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=2" /Gm-  /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"pch.h" /Fp"Release\api_dll.pch" /Fa"Release\" 

    Linker:

    link api_dll.obj /OUT:"c:\pracs\metro\api_dll\Release\api_dll.dll" /DLL %winlibpath% %vclibpath% %vclibs%  /NOLOGO "runtimeobject.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib"  /MANIFEST /ManifestFile:"Release\api_dll.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'"  /SAFESEH /SUBSYSTEM:WINDOWS /TLBID:1 /WINMD /WINMDFILE:"c:\pracs\metro\api_dll\Release\api_dll.winmd" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE  /NODEFAULTLIB:libcmt

    Any toughts whats going on?


    Aptexan

    Tuesday, February 21, 2012 8:39 PM

Answers

  • Hi I followed up with DavidLamb about your repro and I cannot repro the issue on the Beta drop. Could you try with the Beta release and see if you can still repro the issue?

    Li Shao, MSFT


    Li Shao

    Friday, March 02, 2012 5:28 AM
  • Finally on the beta release I was able to register the metro  app successfully.

    Thanks everyone for the help.


    Aptexan

    • Marked as answer by Aptexan_ Monday, March 12, 2012 9:33 PM
    Friday, March 09, 2012 2:26 PM

All replies

  • I wonder if it is possible that it is smart enough that it knows that you have included a dll that you are not using and this it fails it?  wild guess.

    www.puttnutz.com

    Tuesday, February 21, 2012 11:03 PM
  • I am pretty sure that, it is not complaining because the DLL is not used. It is complaining (certify fails) because the packaged DLL uses the restrictedf APIs (however the DLL does not use any of the Windows API, windows.h is not even included). And the List of the restricted API which certify lists as the reason of failure is same as when you try to certify a Debug build App. I listed the command line options for building the DLL to confirm that DLL is not built as debug build. The App is built from VS11 IDE and it is for sure release build. If DLL is not packaged and everything else is same the App certifies successfully.


    Aptexan

    Tuesday, February 21, 2012 11:10 PM
  • My first attempt to repro this scenario failed, so I must be missing something. Could you email me the Win32 DLL project that is causing this issue?

    DavidLam

    a t

    Microsoft dot

    Com

    Thanks,

    -David

    Thursday, February 23, 2012 12:07 AM
    Moderator
  • I just have one .cpp and one .h file(listed below), and I use the command line listed in original post to build, no VS project.

    //////////////////////////////////
    //file: api_dll.h
    //////////////////////////////////
    #pragma once

    #ifdef _USRDLL
    #define DLL_PUBLIC __declspec(dllexport)
    #else
    #define DLL_PUBLIC __declspec(dllimport)
    #endif

    namespace api
    {

    extern "C"
    {

    DLL_PUBLIC int dll_func(int i);

    }

    } //ns

    //////////////////////////////////
    //file: api_dll.cpp
    //////////////////////////////////
    #include "api_dll.h"

    namespace api
    {

    DLL_PUBLIC int dll_func(int i)
    {
     i = i * 2;
     return i;
    }

    } //ns


    Aptexan

    Thursday, February 23, 2012 5:15 PM
  • That doesn't seem to be the issue as I am still unable to replicate the certification failure using that src and compiler commands.

    What steps did you take to get this DLL packaged in the Metro style app?

    If you have another Win8 development system, try deploying the app to that system and running the certification on that system. You can also send my the appx package or the solution that is including the Win32 binary to see if I can spot the cause.

    Thanks,

    -David

    Friday, February 24, 2012 2:44 AM
    Moderator
  • I think I should have mentioned this first, the Win8 Dev Preview build is 8102. I copied the release built DLL  in same folder as the .vcxproj file folder of the consuming Metro App. Then added the DLL to the project and marked it as a content file. Built the Metro app. and Deployed.

    How do I send the project and the package file?

    Thanks!


    Aptexan

    Friday, February 24, 2012 2:10 PM
  • That should have worked just fine. Send me an email and I'll send you a private upload point to transfer the files for us to review.

    DavidLam

    a t

    Microsoft dot

    Com

    Thanks!

    Friday, February 24, 2012 4:38 PM
    Moderator
  • I don't have your email, I tried  ro reply the forum alert email and tried david.lamb@microsoft.com.

    Where should I email?

    Thanks!


    Aptexan

    Friday, February 24, 2012 11:00 PM
  • I broke up my email name in earlier posts to avoid those screen scraping for email addresses. DavidLam@Microsoft.com


    Saturday, February 25, 2012 1:09 AM
    Moderator
  • Hi I followed up with DavidLamb about your repro and I cannot repro the issue on the Beta drop. Could you try with the Beta release and see if you can still repro the issue?

    Li Shao, MSFT


    Li Shao

    Friday, March 02, 2012 5:28 AM
  • Finally on the beta release I was able to register the metro  app successfully.

    Thanks everyone for the help.


    Aptexan

    • Marked as answer by Aptexan_ Monday, March 12, 2012 9:33 PM
    Friday, March 09, 2012 2:26 PM