title: How to extract a substring from a PWSTR in C++
body: <p>I'm currently modifying a credential provider for Windows 7, in C++. The Windows SDK requires use of PWSTR.</p>
  
  <p>I've hit a problem where the username is sometimes being passed as DOMAIN\username and sometimes as domain.tld\username and sometimes just username. What I'd like to do is extract the username from this, and only take the substring after the slash.</p>
  
  <p>I'm new to C++ and none of the string functions appear to work with PWSTR. I've tried a few conversions to wchar_t* but it's still not getting me anywhere.</p>
  
  <p>How can this be achieved?</p>
  
  <p>TIA</p>