title: WPD Object Filename Truncated at '.'
body: <p>In my project, I'm using the Windows Portable Device (WPD) API to enumerate the contents of a mobile device. <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd319330(v=vs.85).aspx" rel="nofollow noreferrer">WPD API Enumeration Guide</a>. I'm able to enumerate over each object and view their properties as shown in the API programming guide. <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd388996(v=vs.85).aspx" rel="nofollow noreferrer">WPD API Properties Guide</a></p>
  
  <p>However when I try to get an object's name that has a <code>.</code> within the name, the returned value is truncated at that <code>.</code></p>
  
  <pre><code>HRESULT hr = objectProperties-&gt;GetStringValue(WPD_OBJECT_NAME, &amp;strOriginalFileName);
  if(FAILED(hr))
      return false;
  
  PWSTR wideStr = strOriginalFileName;
  char buffer[20];
  wcstombs(buffer, wideStr, 20);
  
  qDebug() &lt;&lt; buffer;
  </code></pre>
  
  <p>So for example, an object (folder on the device) with the name of <code>com.example</code> is returned as <code>com</code>. This becomes an obvious issue when I'm trying to locate a specific filepath on the device.</p>
  
  <p>I can't seem to figure out what's wrong. Am I misunderstanding how the filename actually is? Is <code>example</code> another property or something within the <code>com</code> object? I'm very confused.</p>
  
  <p>EDIT:
  So I used the WPD API sample software to retrieve all the object properties of the com.example object and you can see that WPD itself cannot get the full folder name. <a href="https://i.stack.imgur.com/g5tjm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g5tjm.png" alt="enter image description here"></a></p>
  
  <p>Thanks for your time!</p>