diff --git a/dlls/shell32/shellstring.c b/dlls/shell32/shellstring.c index 69a531411b5..f01b6dfc354 100644 --- a/dlls/shell32/shellstring.c +++ b/dlls/shell32/shellstring.c @@ -336,6 +336,42 @@ int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet) return pos; } +/************************************************************************* + * StrCatBuffA [SHLWAPI] + * + * Appends back onto front, stopping when front is size-1 characters long. + * Returns front. + * + */ +LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size) +{ + LPSTR dst = front + lstrlenA(front); + LPCSTR src = back, end = front + size - 1; + + while(dst < end && *src) + *dst++ = *src++; + *dst = '\0'; + return front; +} + +/************************************************************************* + * StrCatBuffW [SHLWAPI] + * + * Appends back onto front, stopping when front is size-1 characters long. + * Returns front. + * + */ +LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size) +{ + LPWSTR dst = front + lstrlenW(front); + LPCWSTR src = back, end = front + size - 1; + + while(dst < end && *src) + *dst++ = *src++; + *dst = '\0'; + return front; +} + /************************* OLESTR functions ****************************/ /************************************************************************ diff --git a/dlls/shell32/shlwapi.spec b/dlls/shell32/shlwapi.spec index ce23d6d0052..9b3e735b0ca 100644 --- a/dlls/shell32/shlwapi.spec +++ b/dlls/shell32/shlwapi.spec @@ -608,6 +608,8 @@ init ShlwapiLibMain @ stub StrCSpnIA @ stub StrCSpnIW @ stdcall StrCSpnW (wstr wstr) StrCSpnW +@ stdcall StrCatBuffA (str str long) StrCatBuffA +@ stdcall StrCatBuffW (wstr wstr long) StrCatBuffW @ stub StrCatW @ stdcall StrChrA (str long) StrChrA @ stub StrChrIA