Commit cbb70ff0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Return NULL in IHTMLDocument2::get_cookie if InternetGetCookieExW failes.

parent 97f9dc7f
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment