Microsoft KB Archive/250351

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:51, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base

Windows Media Format SDK Tool to Verify Presence of DCOM

Article ID: 250351

Article Last Modified on 11/7/2002


  • Microsoft Windows Media Services 4.0

This article was previously published under Q250351


Because the Windows Media Device Manager redistributed version (WMDMredist) requires the Distributed Component Object Model (DCOM) to successfully register all of its components, and because WMDMredist does not verify if DCOM is installed, it may be useful for third-party application writers to include a DCOM sniffer to see whether WMDMredist should be installed, or whether users should be directed to a download site or a computer store.


The following is the current DCOM sniffer used in the Windows Media Format SDK version 4.1. It detects for the presence of DCOM, and also checks to see if DCOM is enabled:

BOOL DCOMIsInstalled()
// This function verifies that DCOM is enabled
    HKEY hKey = NULL;
    TCHAR szDesiredKey[MAX_PATH];
    long lResult = ERROR_SUCCESS;
    _tcscpy( szDesiredKey, _T("Software\\Microsoft\\OLE") );

    lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE, szDesiredKey, 
0, KEY_QUERY_VALUE, &hKey );

    if( ERROR_SUCCESS != lResult )
        return( FALSE );

    DWORD cbSize = sizeof( szDesiredKey );

    lResult = RegQueryValueEx( hKey, _T("EnableDCOM"), NULL, 
NULL, ( LPBYTE )szDesiredKey, &cbSize );
    RegCloseKey( hKey );

    if( ERROR_SUCCESS == lResult )
        return( 0 == _tcsicmp( _T("y"), szDesiredKey ) );

    return( FALSE );

DCOM packages can be found on the "Downloads and CD-ROMs" page on the following Microsoft Web site:

DCOM is present by default on Windows 98 , Windows 98 Second Edition, Windows NT 4.0 SP3, and Windows 2000.

Additional query words: netshow

Keywords: kbinfo KB250351