Call CoInitializeSecurity in FM Pro startup

Idea created by monkeybreadsoftware on Oct 19, 2017

    MBS FileMaker Plugin offers WMI functions to query system functions.

    For that we need to call CoInitializeSecurity, which used to work for FileMaker 14.

    But in FileMaker 15 and 16 you create COM objects before we have a chance to call this, so our call is too late and fails.


    So after CoInitialize, we would need:


    HRESULT hr2 =  CoInitializeSecurity(


      -1,                          // COM authentication

      NULL,                        // Authentication services

      NULL,                        // Reserved

      RPC_C_AUTHN_LEVEL_DEFAULT,   // Default authentication

      RPC_C_IMP_LEVEL_IDENTIFY,    // Default Impersonation

      NULL,                        // Authentication info

      EOAC_NONE,                   // Additional capabilities

      NULL                         // Reserved



    or similar to make WMI queries.


    If you have any questions, let me know.

    Ideally you could just copy & paste this call in your FMP C code on windows initialization code.