::RegCloseKey(fileTypeKey);
static nsresult GetMIMEInfoFromRegistry( LPBYTE fileType, nsIMIMEInfo *pInfo ){    nsresult rv = NS_OK;    NS_ENSURE_ARG( fileType );    NS_ENSURE_ARG( pInfo );    // Get registry key for the pointed-to "file type."    HKEY fileTypeKey = 0;    LONG rc = ::RegOpenKeyEx( HKEY_CLASSES_ROOT, (const char *)fileType, 0, KEY_QUERY_VALUE, &fileTypeKey );    if ( rc == ERROR_SUCCESS )    {        // OK, the default value here is the description of the type.        DWORD lenDesc = 0;        LPBYTE pDesc = GetValueBytes( fileTypeKey, "", &lenDesc );        if ( pDesc )        {            PRUnichar *pUniDesc = new PRUnichar[lenDesc+1];            if (pUniDesc) {              int len = MultiByteToWideChar(CP_ACP, 0, (const char *)pDesc, -1, pUniDesc, lenDesc);               pUniDesc[len] = 0;              pInfo->SetDescription( pUniDesc );              delete [] pUniDesc;            }            delete [] pDesc;        }    }    else    {        rv = NS_ERROR_FAILURE;    }    return rv;}