Error registering hosted class code 0x80040111

Hello Jicky,
  • Hello Jicky,

    1. I guess the next thing to do would be the tough job of debugging the class factory code.

    2. To do this, you need to start debugging your COM DLL and set the C# client app as the startup application.

    2.1 Via project properties, set the debugger type to «Mixed» so that you can see the C# client code.

    2.2 Then place a breakpoint in your global DllGetClassObject() function. This function was generated by the ATL wizard for your DLL. It should look something like the following :

    STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
    {
        return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
    }

    2.3 Start debugging. Note well that if you are able to reach the DllGetClassObject() function, it is clear that your COM DLL has been registered correctly. If you are not able to even reach DllGetClassObject(), something has gone wrong and we may be
    back to registration problems again.

    2.4 If you do reach DllGetClassObject(), step through all the way until you reach the AtlComModuleGetClassObject() function (this is the ATL source code from my machine which uses VS2008) :

    ATLINLINE ATLAPI AtlComModuleGetClassObject(_ATL_COM_MODULE* pComModule, REFCLSID rclsid, REFIID riid, LPVOID* ppv)
    {
     if (ppv == NULL)
      return E_POINTER;
     *ppv = NULL;

     ATLASSERT(pComModule != NULL);
     if (pComModule == NULL)
      return E_INVALIDARG;
     if (pComModule->cbSize == 0)  // Module hasn’t been initialized
      return E_UNEXPECTED;

     HRESULT hr = S_OK;

     for (_ATL_OBJMAP_ENTRY** ppEntry = pComModule->m_ppAutoObjMapFirst; ppEntry < pComModule->m_ppAutoObjMapLast; ppEntry++)
     {
      if (*ppEntry != NULL)
      {
       _ATL_OBJMAP_ENTRY* pEntry = *ppEntry;
       if ((pEntry->pfnGetClassObject != NULL) && InlineIsEqualGUID(rclsid, *pEntry->pclsid))
       {
        if (pEntry->pCF == NULL)
        {
         CComCritSecLock<CComCriticalSection> lock(pComModule->m_csObjMap, false);
         hr = lock.Lock();
         if (FAILED(hr))
         {
          ATLTRACE(atlTraceCOM, 0, _T(«ERROR : Unable to lock critical section in AtlComModuleGetClassObjectn»));
          ATLASSERT(0);
          break;
         }
         if (pEntry->pCF == NULL)
          hr = pEntry->pfnGetClassObject(pEntry->pfnCreateInstance, __uuidof(IUnknown), (LPVOID*)&pEntry->pCF);
        }
        if (pEntry->pCF != NULL)
         hr = pEntry->pCF->QueryInterface(riid, ppv);
        break;
       }
      }
     }

     if (*ppv == NULL && hr == S_OK)
      hr = CLASS_E_CLASSNOTAVAILABLE;
     return hr;
    }

    Note the highlighted error code CLASS_E_CLASSNOTAVAILABLE. This error code has value
    0x80040111. Step through and see in what situation will this error code be returned.

    2.5 Best of luck, Jicky.

    — Bio.

    • Proposed as answer by

      Wednesday, April 13, 2011 10:43 AM

    • Marked as answer by
      Leo Liu — MSFTModerator
      Wednesday, April 20, 2011 1:52 AM

  • In this post, you will learn more about SCCM 2103 known issues. The production version of 2103 is generally available. Let’s understand the fixes already issued with the 2103 version. You can check out our 2103 upgrade guide.

    The latest version of ConfigMgr 2103 contains fixes and feature improvements. As I always say, this is not an all-inclusive list of changes and fixes included in the 2103 version. However, the list of fixes documented below is most relevant for SCCM admins as per the Microsoft production team.

    Related Post – Top 5 New Features of SCCM 2103 | ConfigMgr.

    SCCM 2103 Hotfixes

    Let’s check the hotfixes released for the Configuration Manager 2103 production version. I will try to update this list whenever Microsoft releases new hotfixes for 2103. There are two hotfixes released for 2103 while the last update of this post.

    Patch My PC

    • The Hotfix KB10372804 to fix MBAM Agent API to escrow recovery keys issue.
    • Out of Band Hotfix KB10216365 to fix SQL always-on issue.
    • Latest Hotfix for SCCM 2103 – KB10036164 (Update Rollup).
    • First KB released for SCCM 2103 is KB9603111 (available in console).
    • 2nd KB KB9833643 for ConfigMgr 2103 (Out of Band).
    • Client Update KB10589155.
    • Tenant Attach Fix KB10582136.

    The following are the SCCM known issues fixed with the Configuration Manager (a.k.a SCCM) 2103 version. This is not an all-inclusive list of fixes that are included with ConfigMgr 2103. You can read more about this from Microsoft documentation.

    📢✅ Description
    ADR ADR fails on servers that do not have internet access after updating to 2010
    Azure Migration Tool The ExtendMigrateToAzure tool fails to add accounts to the local administrators’ group
    CAS Removal Adding a new DP to a package triggers the redistribution of that package to all DP’s after CAS removal
    CAS Removal The Configuration.mof used with hardware inventory is not created on a primary site after removing CAS
    Client Client user policy namespaces are created on multi-user terminal servers even when explicitly disabled
    Client Clients do not download package content over a metered connection
    Client Computers randomly don’t receive policy data based on computer variables (SMS_MachineVariable)
    Client Cache Non-zero success codes, such as 3010 (restart pending) – The exit code is 3010, the execution status is FailureNonRetry
    Cloud DP The upload of more than 10 packages at one time to a cloud distribution point fails
    CMPivot The CMPivot feature incorrectly requires access to the default security scope
    Collection Collection Evaluator Performance Improvement
    Co-Management Co-management workloads may be unexpectedly deployed to newly installed ConfigMgr clients.
    Content Library Multiple improvements were made to the content library move and cleanup processes
    DP Orphaned content may be left after deleting application revisions
    Hotfix Installation SCCM hotfixes that only update the admin console will no longer require a site reset.
    Microsoft Defender State messages generated by the on-premises ATP monitoring feature may fail to process on the site server
    OSD OSD from boot media fail to retrieve content from a cloud DP if custom ports are defined
    OSD The SMS Agent Host (ccmexec.exe) incorrectly tries to resolve a site code when you use standalone media
    Reporting The Compliance 4 – report terminates unexpectedly
    SQL Server SQL Server TempDB may grow unexpectedly because Datawarehouse issues
    SQL Server Improvements were made to the SQL Server change tracking cleanup task.
    SUP The synchronization process fails on a remote software update point (SUP)
    Task Sequence  A command defined in the SMSTSPostAction task sequence variable runs twice after a device restart.
    Task Sequence  Task sequences may fail or take longer than expected to run following a computer restart
    Task Sequence  The Format and Partition Disk task sequence step fails when more than 99 disks are present
    Task Sequence  Various custom client settings may fail to apply if an operating system deployment task sequence fails to remove WMI instances
    SCCM 2103 Known Issues – Fixes table | ConfigMgr

    SCCM 2103 Known Issues

    Microsoft added a new known issue to the document (documented known issues) to the 2103 release notes. I’ll keep the list of SCCM 2103 known issues updated. Also, if you want to highlight some known issues, please add them to the comments section below.

    Latest Known Issues of SCCM 2103

    • Task sequences/task sequence steps, created before installation of version 2103 update fail to import. The Import Task Sequence Wizard displays the following error –
      • One or more errors occurred result may be incomplete.
    • No data is shown in the Windows 10 servicing dashboard, even after completing the troubleshooting steps listed in the following support article. The Windows 10 servicing dashboard shows no data
    • The New-CMBootableMedia PowerShell cmdlet returns the error Could not find the SCCM UI installation directory after updating to version 2103.
    • SCCM Azure Active Directory (AAD) joined clients that are also using PKI issued certs can get into a high CPU utilization situation that impacts the end-user. This occurs because of an issue with the SMS Agent Host (ccmexec.exe) attempting to continually renew the “self-prove” token with the Management Point (MP).
    • During reassignment from one site to another, clients are unable to evaluate policy or communicate via the notification channel. Errors resembling the following are recorded in the ccmexec.log file.
      • Error registering hosted class ‘{Class_GUID}’. Code 0x80040111.
    • The report Compliance 4 – Updates by vendor month year does not contain expected data.
    • App usage data is stale or unavailable for devices in the Desktop Analytics portal in the Microsoft Endpoint Manager admin center. This only affects notebook computers that run for multiple days without restarting. An error resembling the following is recorded in the SensorManagedProvider.log file on affected devices.
      • Other exception – Value was either too large or too small for an Int32.
    • After updating to SCCM’s current branch, version 2103, a backlog of .MEP (machine extended policy) files occur in the PolicyPV inbox on the site server. This backlog also causes delays in processing site reassignment data.
    • Devices upgrade to the 2103 version of the SCCM client faster than expected after promoting the upgrade from pre-production. In addition, the WebView 2 client component is installed repeatedly.
    • State message processing hangs when encountering a corrupt file instead of discarding the file as expected. Errors resembling the following are recorded in the statesys.log file. –
      • Thread ‘State Message Processing Thread #0″ id:14888 terminated abnormally.
    • State message processing fails for some cloud management gateway (CMG) messages. Errors resembling the following are recorded in the statesys.log file.
      • SQL MESSAGE: dbo.spProcessStateReport – Error: Record 1 returned an ‘invalid record’ return code and failed processing with error 8115.
    • A new SCCM console extension created for the community hub for version 2103 will fail to load if a prior console extension modifies the same node with the same action.
    • The SQL Server move process fails after a highly available site is failed over to the passive site server. This occurs due to a certificate problem that resembled the following in the ConfigMgrSetup.log file.
      • ERROR: Failed to decrypt SQL Server machine serialized pfx certificate (LastError=0)
    • The Wake on LAN feature does not function as expected after a central administration site (CAS) is removed due to a missing site control property value.
    • The SMS Agent Host service may terminate unexpectedly due to a policy agent issue.
    • CMPivot queries do not run on computers configured with the Japanese system locale.
    • After removing a central administration site, packages are distributed to all distribution points (DP) when adding them to just a single new DP.
    • Failover from an active to a passive site fails in an environment with a large number of orphaned package status data records.

    Issue #1 – Old Console Extensions

    Console Your old-style console extensions will stop working when you enable Only allow console extensions that are approved for the hierarchy option. You can’t use the unapproved extensions until you approve from the new Console Extension node. 
    SCCM 2103 Known Issues – Console Extension

    The above console extension SCCM 2103 known issue will be applicable only if you have enabled the following check box from hierarchy settings properties. You can get more details in Microsoft Docs.

    • Disable the option “Only allow console extensions that are approved for the hierarchy” to make the old-style console extensions work again.
    SCCM 2103 Known Issues Fixes | ConfigMgr
    SCCM 2103 Known Issues Fixes | ConfigMgr

    Issue #2 – Console Lock?

    I have seen some issues with admin console usability/accessibility. Basically, the console gets locked when you open more than one nested window.

    Adaptiva

    I can’t use the console until I close the Query Rule Properties Window as you see in the below picture. I have experienced this in the Namaste Techies show as well.

    SCCM 2103 Known Issues Fixes | ConfigMgr
    SCCM 2103 Known Issues Fixes | ConfigMgr

    This SCCM 2103 known issue is not only related to collection, but it’s wider applicable to all parts of the console. For example, if you open up more than one nested Window from the console, it disables access to the console.

    What do I mean by more than one nested Window? Let’s take an example to explain it better.

    • If I select a Task Sequence and click on the EDIT button, it opens up an additional Window #1.
    • If I go to any one of the actions and click on Add condition option, it opens up the additional Window #2 on top of Window #1.
    • Now the console is locked! You can access anything from the console until you close Windows #2.
    SCCM 2103 Known Issues Fixes | ConfigMgr
    SCCM 2103 Known Issues Fixes | ConfigMgr

    Issue #3 – 2103 MP installation failed

    Panu Saukko (Microsoft MVP) shared an issue on Twitter related to SCCM 2103 Management Point installation that failed with the following error – LocalSystem’s decimal separator char was “,” instead of “.”! And there was one decimal value in the MOF file.

    Panu got it working by changing the decimal separator, but it took some time to figure out what was wrong. More details are available in the Twitter thread.

    Production Ready

    This post is to help SCCM admins easily go through a list of SCCM 2103 Known Issues production versions. Most of the highlighted issues are collected via social media channels and Microsoft documentation.

    NOTE! – These known issues are not blockers for SCCM 2103 production upgrade.

    Resources

    • Release notes – Configuration Manager | Microsoft Docs
    • Top 5 New Features of SCCM 2103 | ConfigMgr
    • SCCM 2103 is Generally Available | End of Opt-in Phase | ConfigMgr

    Author

    Anoop is Microsoft MVP! He is a Solution Architect in enterprise client management with more than 20 years of experience (calculation done in 2021) in IT. He is a blogger, Speaker, and Local User Group HTMD Community leader. His main focus is on Device Management technologies like SCCM 2012, Current Branch, and Intune. E writes about ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc…

    @tabletrtd

    Hello.
    Does not work mssqlPipe. Please help.

    Launching from cmd:
    c:tempmssqlPipe.exe 127.0.0.1 as sa:111 backup TMP

    And returned:
    mssqlPipe 1.2.1
    Failed to cocreate device set: 80040111

    SQL Server is working, password is right.

    DBMS:
    Microsoft SQL Server 2005 — 9.00.5324.00 (X64) Aug 24 2012 18:28:47 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)

    OS:
    Microsoft Windows Server 2008 R2 Standard
    6.1.7601 Service Pack 1 сборка 7601

    @adamwalling

    The error 0x80040111 basically means that the application requested a COM object but the class factory could not create it. This is usually a permissions issue. There has been an update to mssqlPipe to automatically elevate the process if it runs into issues with not running as admin, which may be the case here.

    @edo1

    I have the same issue with current EXE file.
    I run it from elevated poweshell console so it shouldn’t be a permission issue.
    No such issue with sqlpipe and MSSQLCompressedBackup

    @adamwalling

    Hm, both sqlpipe and this should be creating the instance with CLSID_MSSQL_ClientVirtualDeviceSet — I’ll take a look into the _com_ptr_t implementation this weekend to see if something different is occurring behind the scenes that might be causing trouble. Only thing I can think of is that _com_ptr_t is using CLSCTX_ALL versus using CLSCTX_INPROC_SERVER explicitly, but might be worth a shot (since if the other ones are used, then _com_ptr_t does the whole OleRun thing)

    @martin-schiel

    Any news on this? I’m having a similar problem:

    mssqlPipe sql2008 backup database to database.bak

    Failed to create device set: 80770007

    @adamwalling

    The command you included does not included a database name, which might be problematic. This does appear to be a somewhat different error though. The instance name is SQL2008 on that local machine right?

    @martin-schiel

    Thanks for your quick reply. Yes «sql2008» is the instance name. I have also tried to run as admin. I used the first example from the README to try, but i have now modified the command like this, but with the same result:

    `mssqlPipe sql2008 backup database DBName to DBName.bak

    mssqlPipe 1.2.1

    Failed to create device set: 80770007`

    @adamwalling

    0x80770007 is defined as VD_E_INSTANCE_NAME though your instance name is correct. This is failing at a relatively simple part of the application, unfortunately.

    The website http://www.sqlbackuprestore.com/vdierrors.htm actually has a lot of useful info about the VDI interface to sql server, and actually calls out this error code as an example of registration issues of the VDI COM interface — http://www.sqlbackuprestore.com/vdiversions.htm for example. This might be the culprit. I’m curious if anything stands out or mismatches.

    This might explain the original 0x80040111 error as well.

    @martin-schiel

    @adamwalling

    Wow thanks for letting me know what happened! I’ll have to turn this into a better error message and update docs.

    @SQLSourcerer

    The tool is working great for me on some servers, but not on others. When it doesn’t work, I too am getting error 80040111. I’m invoking it with an account that has local admin on the server, and with an elevated command prompt. The account also has sysadmin on the SQL Server instance. I’m connecting to the default instance and omitting the instance name on the command line. Here’s the command I’m trying to run:

    mssqlpipe pipe from vdi1 | mssqlpipe pipe to vdi2

    Unfortunately, I see no error messages in the event logs related to SQLVDI.

    @basti122303

    hello,
    i get the same error 80040111. I have try to run it in a cmd with and without admin privilegs.
    mssqlpipe backup as sa:passwd does also fail.
    I can connect as administrator and windows login to mssql management tool.

    @adzm

    I believe this issue is due to the COM object that is used to talk to sql to create the virtual device etc is only installed on the actual machine running SQL server; so unfortunately it does not work from other machines. Are you encountering this issue on the same machine running SQL?

    @basti122303

    @adzm

    Interesting, both utils should be using the same coclasses and interfaces and all that. I’ll check to see where I differ. Can you paste the entire error output?

    Понравилась статья? Поделить с друзьями:
  • Error registering appinfo mbean kafka
  • Error region map not found
  • Error region geo
  • Error refreshing package unity
  • Error receiving response header lsphp is killed