Dela via


CRegKey::QueryQWORDValue

Call this method to retrieve the QWORD data for a specified value name.

LONG QueryQWORDValue(
   LPCTSTR pszValueName,
   ULONGLONG& qwValue 
) throw( );

Parameters

  • pszValueName
    Pointer to a null-terminated string containing the name of the value to query.

  • qwValue
    Pointer to a buffer that receives the QWORD.

Return Value

If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_QWORD, ERROR_INVALID_DATA is returned.

Remarks

This method makes use of RegQueryValueEx and confirms that the correct type of data is returned. See RegQueryValueEx for more details.

Security noteSecurity Note

This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the RegQueryValueEx function used by this method does not explicitly handle strings which are NULL terminated. Both conditions should be checked for by the calling code.

Requirements

Header: atlbase.h

See Also

Reference

CRegKey Class

CRegKey::SetQWORDValue

CRegKey::QueryBinaryValue

CRegKey::QueryDWORDValue

CRegKey::QueryGUIDValue

CRegKey::QueryMultiStringValue

CRegKey::QueryStringValue

Other Resources

CRegKey Members