<div class="content" name="GetChildPaths" uuid="e04a9303-6916-4f27-8668-3e8130630dfb"><p>The GetChildPaths method returns all child nodes of a
specified path from a supplied metadata handle.</p><dl>
<dd>
<div><pre> HRESULT GetChildPaths(
     [in] METADATA_HANDLE hMDHandle,
     [unique, in, string] LPCWSTR pszMDPath,
     [in] DWORD cchMDBufferSize,
     [in, out, unique, size_is(cchMDBufferSize)] WCHAR *pszBuffer,
     [in, out, unique] DWORD *pcchMDRequiredBufferSize
 );
</pre></div>
</dd></dl><p><b>hMDhandle: </b>An unsigned 32-bit integer value
specifying a handle to a node in the <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_086b13f2-2715-4000-a16c-6acc3d59cc19" data-linktype="relative-path">metabase</a> with read
permissions as returned by the <a href="a54be1d0-009a-493d-a53e-e2f7fbe87293" data-linktype="relative-path">OpenKey</a> method, or the <a href="8abe4b9a-8f39-4761-a64e-912ba20b167f" data-linktype="relative-path">METADATA_MASTER_ROOT_HANDLE</a>.</p><p><b>pszMDPath: </b>A pointer to a Unicode string that
contains the path of the node to be opened, relative to the <i>hMDHandle</i>
parameter.</p><p><b>cchMDBufferSize: </b>The size, in <a href="../ms-dtyp/7df7c1d5-492c-4db4-a992-5cd9e887c5d7" data-linktype="relative-path">WCHAR</a>,
of the <i>pszBuffer</i> buffer to hold the paths for all child nodes under the
path specified.</p><p><b>pszBuffer: </b>A pointer to a Unicode character
buffer passed in by the caller to store the retrieved child paths. The return
data will be a set of WCHAR strings, where each includes two terminating null
characters.</p><p><b>pcchMDRequiredBufferSize: </b>An integer value
indicating the required size of the buffer if the supplied buffer proves to be
insufficient. If the supplied buffer is sufficient, this value will not be
adjusted.</p><p><b>Return Values: </b>A signed 32-bit value that
indicates return status. If the method returns a negative value, it failed. If
the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a
Win32 error code in the lower 16 bits. Zero or positive values indicate success,
with the lower 16 bits in positive nonzero values containing warnings or flags
defined in the method implementation. For more information about Win32 error
codes and <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
values, see <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x80070000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070003 ERROR_PATH_NOT_FOUND</td>
  <td>The system cannot find the path specified.</td>
 </tr><tr>
  <td>0x80070057 E_INVALIDARG</td>
  <td>One or more arguments are invalid.</td>
 </tr><tr>
  <td>0x80070005 ERROR_ACCESS_DENIED</td>
  <td>Access is denied.</td>
 </tr><tr>
  <td>0x80070008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>Not enough storage is available to process this command.</td>
 </tr><tr>
  <td>0x8007000E E_OUTOFMEMORY</td>
  <td>There was not enough memory to complete the method call.</td>
 </tr><tr>
  <td>0x8007007A ERROR_INSUFFICIENT_BUFFER</td>
  <td>The data area passed to a system call is too small.</td>
 </tr><tr>
  <td>0x800700A0 ERROR_BAD_ARGUMENTS</td>
  <td>One or more arguments are not correct.</td>
 </tr><tr>
  <td>0x80004005 E_FAIL</td>
  <td>An unspecified error occurred.</td>
 </tr><tr>
  <td>0x80070006 E_HANDLE</td>
  <td>An invalid handle was passed.</td>
 </tr><tr>
  <td>0x800CC800 MD_ERROR_NOT_INITIALIZED</td>
  <td>Metadata has not been initialized.</td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
beyond those thrown by the underlying <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p><p>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_e127848e-c66d-427d-b3aa-9f904fa4ada7" data-linktype="relative-path">opnum</a>
field value for this method is 40. </p><p> When processing this call, the server MUST do the
following: </p><ul><li><p><span><span> 
</span></span>The server returns all child paths that are relative to the path
provided under the node that is represented by the <i>hMDHandle</i> parameter.
The server MUST return these as a list of WCHAR strings, where each string
includes the terminating null character, and the entire list is also followed
by a terminating null character.</p>
</li><li><p><span><span> 
</span></span>The strings returned by the server MUST be compatible with the
format used by the OpenKey method to open those nodes for retrieving data. </p>
</li><li><p><span><span> 
</span></span>If the <i>hMDHandle</i> parameter is not a valid open handle to
the metadata (retrieved by calling OpenKey), the server MUST return an E_HANDLE
error code.</p>
</li><li><p><span><span> 
</span></span>If the path requested does not exist in the metadata, the server
MUST return the HRESULT derived from the ERROR_PATH_NOT_FOUND error code.</p>
</li><li><p><span><span> 
</span></span>If the <i>cchMDBufferSize</i> parameter is not large enough to
contain the child path strings that include the terminating null character, the
server MUST return the HRESULT derived from the ERROR_INSUFFICIENT_BUFFER error
code, and the server MUST set the <i>pcchMDRequiredBufferSize</i> value to the
size needed.</p>
</li></ul></div>