urlmon: Improve ObtainUserAgentString conformance to native.

This commit is contained in:
Misha Koshelev 2007-07-09 21:49:58 -05:00 committed by Alexandre Julliard
parent 17ba74195b
commit e4282a59dd
1 changed files with 8 additions and 3 deletions

View File

@ -304,13 +304,18 @@ HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPSTR pcszUAOut, DWORD *cbS
{
FIXME("(%d, %p, %p): stub\n", dwOption, pcszUAOut, cbSize);
if(dwOption) {
ERR("dwOption: %d, must be zero\n", dwOption);
if (pcszUAOut == NULL || cbSize == NULL)
return E_INVALIDARG;
if (*cbSize < sizeof(Agent))
{
*cbSize = sizeof(Agent);
return E_OUTOFMEMORY;
}
if (sizeof(Agent) < *cbSize)
*cbSize = sizeof(Agent);
lstrcpynA(pcszUAOut, Agent, *cbSize);
lstrcpynA(pcszUAOut, Agent, *cbSize);
return S_OK;
}