IWbemPathKeyList::GetKey method (wmiutils.h)
The IWbemPathKeyList::GetKey method retrieves a key's name or value. Keys are indexed from 0 (zero), though the order of the keys is not significant.
HRESULT GetKey( ULONG uKeyIx, ULONG uFlags, ULONG *puNameBufSize, LPWSTR pszKeyName, ULONG *puKeyValBufSize, LPVOID pKeyVal, ULONG *puApparentCimType );
Key index beginning at 0 (zero).
Reserved. Must be 0 (zero).
Caller sets this to the number of characters that the name buffer can hold. Upon success, this is set to the number of characters copied into the buffer including the terminating NULL.
Buffer into which the name is to be copied. Because not all keys have a name, this parameter value would be NULL for an implicit key.
Caller sets this to the number of characters that the value buffer can hold. Upon success, this is set to the number of characters copied into the buffer including the NULL terminator.
Buffer where data is to be copied.
Pointer to a long which is set to the CIM type.
This method returns an HRESULT indicating the status of the method call.
It is a recommended practice to determine how big a buffer is needed by calling this method, passing in a NULL pointer for the buffer, and setting its size parameter to 0 (zero). Upon return, the size parameter of the buffer indicates how large of a buffer is needed for the string and its NULL terminator. Then you can call the method to get the buffer value.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|