Implement ParseFieldW function based on its ANSI sibling.

This commit is contained in:
Rolf Kalbermatter 2002-12-06 23:20:52 +00:00 committed by Alexandre Julliard
parent bc8bd72297
commit 247457c184
2 changed files with 21 additions and 4 deletions

View File

@ -64,7 +64,8 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len);
BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest); BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest);
INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM); INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
DWORD WINAPI ParseFieldA(LPCSTR src,DWORD field,LPSTR dst,DWORD len); DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len);
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len);
/**************************************************************************** /****************************************************************************
* Class constructors * Class constructors

View File

@ -107,9 +107,25 @@ DWORD WINAPI ParseFieldA(
*/ */
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
{ {
FIXME("(%s,0x%08lx,%p,%ld) stub\n", WARN("(%s,0x%08lx,%p,%ld) semi-stub.\n", debugstr_w(src), nField, dst, len);
debugstr_w(src), nField, dst, len);
return FALSE; if (!src || !src[0] || !dst || !len)
return 0;
/* skip n fields delimited by ',' */
while (nField > 1)
{
if (*src == 0x0) return FALSE;
if (*src++ == ',') nField--;
}
/* copy part till the next ',' to dst */
while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
/* finalize the string */
*dst = 0x0;
return TRUE;
} }
/************************************************************************* /*************************************************************************