CmSplitDevicePanelId
__int64 __fastcall CmSplitDevicePanelId(STRSAFE_PCNZWCH pszSrc, GUID *Guid, unsigned int *a3, unsigned int *a4){
int inited;
WCHAR v9;
WCHAR *v10;
WCHAR *v11;
unsigned int v12;
unsigned int v13;
UINT64 dwFlags;
wchar_t *EndPtr;
struct _UNICODE_STRING DestinationString;
wchar_t Str[12];
wchar_t pszDest[40];
EndPtr = 0i64;
DestinationString = 0i64;
inited = RtlInitUnicodeStringEx(&DestinationString, (WCHAR *)pszSrc);
if( inited < 0 || (DestinationString.MaximumLength & 0xFFFEu) < 0x52 || pszSrc[38] != 92 )
return(unsigned int)-1073741773;
if( Guid )
{
LODWORD(dwFlags) = 2048;
inited = RtlStringCchCopyNExW(pszDest, 0x27ui64, (WCHAR *)pszSrc, 0x26ui64, 0i64, 0i64, dwFlags);
if( inited < 0 )
return(unsigned int)inited;
RtlInitUnicodeString(&DestinationString, pszDest, v9);
inited = RtlGUIDFromString(&DestinationString, Guid);
if( inited < 0 )
return(unsigned int)-1073741773;
}
v10 = wcschr((WCHAR *)pszSrc + 39, 0x5Cu);
v11 = v10;
if( !v10 )
return(unsigned int)-1073741773;
if( a3 )
{
LODWORD(dwFlags) = 2048;
inited = RtlStringCchCopyNExW(
Str,
9ui64,
(WCHAR *)pszSrc + 39,
((char *)(v10 + 1) - (char *)pszSrc - 80) >> 1,
0i64,
0i64,
dwFlags);
if( inited < 0 )
return(unsigned int)inited;
v12 = wcstoul(Str, &EndPtr, 16i64);
*a3 = v12;
if( v12 > 0xFFFF || !EndPtr || *EndPtr )
return(unsigned int)-1073741773;
}
if( a4 )
{
v13 = wcstoul(v11 + 1, &EndPtr, 16i64);
*a4 = v13;
if( v13 > 7 || !EndPtr || *EndPtr )
return(unsigned int)-1073741773;
}
return(unsigned int)inited;
}Referenced by:
CmGetDevicePanelMappedProperty
CmValidateDevicePanelName
PiPnpRtlSetObjectProperty