IMSAdminBase::GetDataPaths

The IMSAdminBase::GetDataPaths determines which keys in the metabase contain a specified data identifier. This method retrieves the paths of all keys in the subtree relative to a specified starting key that actually contains the identifier. You can use this method to determine the scope of inherited data values, since only keys that contain the identifier itself are returned. Paths to keys that only contain inherited data for the specified identifier will not be returned.

HRESULT GetDataPaths( 
  METADATA_HANDLE hMDHandle,      //metabase handle 
  LPCWSTR pszMDPath,              //path to the key, relative to hMDHandle 
  DWORD dwMDIdentifier,           //identifier of the data 
  DWORD dwMDDataType,             //type of data 
  DWORD dwMDBufferSize,           //the size, in wchars, of pbBuffer 
  LPWSTR pszBuffer,               //the buffer that receives the data 
  DWORD *pdwMDRequiredBufferSize  //if the method fails, receives 
                                  // the required buffer size 
); 
 

Parameters

hMDHandle
Specifies a handle to the metabase. This can either be METADATA_MASTER_ROOT_HANDLE or a handle returned by a previous call to IMSAdminBase::OpenKey.
pszMDPath
Points to a string that contains the path of the key to be opened, relative to hMDHandle. For example, if the handle references the /LM key, you could specify the Web services subkey using the path /W3SVC.
dwMDIdentifier
Specifies the identifier of the data, such as MD_ACCESS_PERM.
dwMDDataType
A DWORD that specifies the type of data to be located. This parameter can be one of the following values:
Data type Description
ALL_METADATA Copy or move all data, regardless of type.
BINARY_METADATA Binary data in any form.
DWORD_METADATA An unsigned 32-bit number.
EXPANDSZ_METADATA A null-terminated string that contains unexpanded environment variables, such as %PATH%.
MULTISZ_METADATA An array of null-terminated strings, terminated by two null characters.
STRING_METADATA A null-terminated ASCII string.


dwMDBufferSize
Specifies the size, in wchars, of the buffer.
pszBuffer
Points to a buffer that receives the data. If the method call is successful, the buffer will contain a double-null terminated multsz of all paths in the subtree that contain the specified identifier. The returned paths are relative to the handle specified. If the identifier exists on the key designated by the handle and path specified, this path will be the first entry in the list.
pdwMDRequiredBufferSize
Points to a DWORD that contains the buffer length required, in wchars. This parameter is only used if the method returns ERROR_INSUFFICIENT_BUFFER.

Return Values

Returns an HRESULT that contains one of the following values:

ERROR_INVALID_PARAMETER The parameter is incorrect.
ERROR_NOT_ENOUGH_MEMORY There is not enough memory to complete the operation.
ERROR_PATH_NOT_FOUND The specified path is not found.
ERROR_SUCCESS The method succeeded.


© 1997 by Microsoft Corporation. All rights reserved.