mshtml: Return NULL in IHTMLDocument2::get_cookie if InternetGetCookieExW failes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
97f9dc7ff4
commit
cbb70ff041
|
@ -904,17 +904,10 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
|
|||
|
||||
size = 0;
|
||||
bret = InternetGetCookieExW(This->window->url, NULL, NULL, &size, 0, NULL);
|
||||
if(!bret) {
|
||||
switch(GetLastError()) {
|
||||
case ERROR_INSUFFICIENT_BUFFER:
|
||||
break;
|
||||
case ERROR_NO_MORE_ITEMS:
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
default:
|
||||
FIXME("InternetGetCookieExW failed: %u\n", GetLastError());
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
|
||||
WARN("InternetGetCookieExW failed: %u\n", GetLastError());
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if(!size) {
|
||||
|
|
|
@ -7276,6 +7276,11 @@ static void test_defaults(IHTMLDocument2 *doc)
|
|||
test_default_selection(doc);
|
||||
test_doc_title(doc, L"");
|
||||
test_dom_implementation(doc);
|
||||
|
||||
str = (BSTR)0xdeadbeef;
|
||||
hres = IHTMLDocument2_get_cookie(doc, &str);
|
||||
ok(hres == S_OK, "get_cookie failed: %08x\n", hres);
|
||||
ok(!str, "cookie = %s\n", wine_dbgstr_w(str));
|
||||
}
|
||||
|
||||
#define test_button_name(a,b) _test_button_name(__LINE__,a,b)
|
||||
|
|
Loading…
Reference in New Issue