From 41771ffe129b36fb9a8f4cd2e02dd020db1a053a Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Thu, 2 Oct 2008 21:26:35 +0200 Subject: [PATCH] push 57b67fa3cb0bad7ec17bcd37e0e1e936855340bd --- dlls/comctl32/tests/header.c | 4 + dlls/dwmapi/dwmapi.spec | 6 +- dlls/dwmapi/dwmapi_main.c | 30 +++++++ dlls/gdi32/font.c | 11 +-- dlls/hhctrl.ocx/help.c | 2 +- dlls/inetcomm/imaptransport.c | 15 +++- dlls/mlang/tests/mlang.c | 32 +++---- dlls/msvcrt/tests/time.c | 8 ++ dlls/msvcrt/time.c | 5 +- dlls/msxml3/saxreader.c | 192 +++++++++++++++++++++++++++++++++++++++-- dlls/oleaut32/recinfo.c | 4 +- dlls/riched20/tests/editor.c | 20 ++++- dlls/rpcrt4/ndr_marshall.c | 3 + dlls/user32/tests/menu.c | 5 +- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + dlls/winex11.drv/xinerama.c | 30 ++++++- dlls/wininet/internet.c | 14 ++- dlls/wininet/tests/http.c | 102 ---------------------- dlls/wininet/tests/internet.c | 135 +++++++++++++++++++++++++++-- dlls/wintab32/context.c | 16 +++- dlls/wintrust/Makefile.in | 2 +- dlls/wintrust/wintrust.spec | 2 +- dlls/wintrust/wintrust_main.c | 25 ++++++ include/dwmapi.h | 2 + programs/regedit/treeview.c | 9 +- tools/wine.inf.in | 3 +- 27 files changed, 517 insertions(+), 162 deletions(-) diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index 4a6c54a49d8..fd0c4c41e72 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -1034,6 +1034,10 @@ static void test_hdm_filterMessages(HWND hParent) else ok_sequence(sequences, HEADER_SEQ_INDEX, filterMessages_seq_noninteractive, "filterMessages sequence testing", FALSE); + /* Some Win9x versions don't send a WM_KILLFOCUS. + * Set the focus explicitly to the parent to avoid a crash. + */ + SetFocus(hParent); DestroyWindow(hChild); } diff --git a/dlls/dwmapi/dwmapi.spec b/dlls/dwmapi/dwmapi.spec index bce53e5fb0c..63ee2f54d33 100644 --- a/dlls/dwmapi/dwmapi.spec +++ b/dlls/dwmapi/dwmapi.spec @@ -25,9 +25,9 @@ @ stub DwmDetachMilContent @ stub DwmEnableBlurBehindWindow @ stub DwmEnableMMCSS -@ stub DwmExtendFrameIntoClientArea -@ stub DwmFlush -@ stub DwmGetColorizationColor +@ stdcall DwmExtendFrameIntoClientArea(long ptr) +@ stdcall DwmFlush() +@ stdcall DwmGetColorizationColor(ptr long) @ stub DwmGetCompositionTimingInfo @ stub DwmGetGraphicsStreamClient @ stub DwmGetGraphicsStreamTransformHint diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c index 6a877014579..e306c56709f 100644 --- a/dlls/dwmapi/dwmapi_main.c +++ b/dlls/dwmapi/dwmapi_main.c @@ -71,6 +71,36 @@ HRESULT WINAPI DwmEnableComposition(UINT uCompositionAction) } /********************************************************************** + * DwmExtendFrameIntoClientArea (DWMAPI.@) + */ +HRESULT WINAPI DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS* margins) +{ + FIXME("(%p, %p) stub\n", hwnd, margins); + + return E_NOTIMPL; +} + +/********************************************************************** + * DwmGetColorizationColor (DWMAPI.@) + */ +HRESULT WINAPI DwmGetColorizationColor(DWORD *colorization, BOOL opaque_blend) +{ + FIXME("(%p, %d) stub\n", colorization, opaque_blend); + + return E_NOTIMPL; +} + +/********************************************************************** + * DwmFlush (DWMAPI.@) + */ +HRESULT WINAPI DwmFlush() +{ + FIXME("() stub\n"); + + return E_NOTIMPL; +} + +/********************************************************************** * DwmSetWindowAttribute (DWMAPI.@) */ HRESULT WINAPI DwmSetWindowAttribute(HWND hwnd, DWORD attributenum, LPCVOID attribute, DWORD size) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 1e8cac33fae..21d2ebb52ca 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -484,14 +484,11 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, HDC hdc ) return 0; } - if (dc->hFont != handle || dc->gdiFont == NULL) + if (GetDeviceCaps( dc->hSelf, TEXTCAPS ) & TC_VA_ABLE) { - if(GetDeviceCaps(dc->hSelf, TEXTCAPS) & TC_VA_ABLE) - { - FONTOBJ *font = GDI_GetObjPtr( handle, FONT_MAGIC ); /* to grab the GDI lock (FIXME) */ - dc->gdiFont = WineEngCreateFontInstance(dc, handle); - if (font) GDI_ReleaseObj( handle ); - } + FONTOBJ *font = GDI_GetObjPtr( handle, FONT_MAGIC ); /* to grab the GDI lock (FIXME) */ + dc->gdiFont = WineEngCreateFontInstance( dc, handle ); + if (font) GDI_ReleaseObj( handle ); } if (dc->funcs->pSelectFont) ret = dc->funcs->pSelectFont( dc->physDev, handle, dc->gdiFont ); diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 6a694a94619..ff703384e67 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -825,7 +825,7 @@ static BOOL HH_CreateHelpWindow(HHInfo *info) /* Read in window parameters if available */ if (info->WinType.fsValidMembers & HHWIN_PARAM_STYLES) - dwStyles = info->WinType.dwStyles; + dwStyles = info->WinType.dwStyles | WS_OVERLAPPEDWINDOW; else dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; diff --git a/dlls/inetcomm/imaptransport.c b/dlls/inetcomm/imaptransport.c index 99011b2b27c..4cef0838d23 100644 --- a/dlls/inetcomm/imaptransport.c +++ b/dlls/inetcomm/imaptransport.c @@ -2,7 +2,20 @@ * IMAP Transport * * Copyright 2008 Hans Leidekker for CodeWeavers - * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #define COBJMACROS diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index f5e7c01114e..a1e5793b4f4 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -406,16 +406,16 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) if (memcmp(cpinfo[i].wszWebCharset, autoW, 5 * sizeof(WCHAR))) { ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszWebCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); - #endif +#endif ok(!lstrcmpiW(cpinfo[i].wszWebCharset, mcsi.wszCharset), - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO "%s != %s\n", wine_dbgstr_w(cpinfo[i].wszWebCharset), wine_dbgstr_w(mcsi.wszCharset)); - #else +#else "wszWebCharset mismatch\n"); - #endif +#endif if (0) { @@ -437,16 +437,16 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) if (memcmp(cpinfo[i].wszHeaderCharset, autoW, 5 * sizeof(WCHAR))) { ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszHeaderCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); - #endif +#endif ok(!lstrcmpiW(cpinfo[i].wszHeaderCharset, mcsi.wszCharset), - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO "%s != %s\n", wine_dbgstr_w(cpinfo[i].wszHeaderCharset), wine_dbgstr_w(mcsi.wszCharset)); - #else +#else "wszHeaderCharset mismatch\n"); - #endif +#endif if (0) { @@ -468,16 +468,16 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) if (memcmp(cpinfo[i].wszBodyCharset, autoW, 5 * sizeof(WCHAR))) { ok (ret == S_OK, "IMultiLanguage2_GetCharsetInfo failed: %08x\n", ret); - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO trace("%s: %u %u %s\n", wine_dbgstr_w(cpinfo[i].wszBodyCharset), mcsi.uiCodePage, mcsi.uiInternetEncoding, wine_dbgstr_w(mcsi.wszCharset)); - #endif +#endif ok(!lstrcmpiW(cpinfo[i].wszBodyCharset, mcsi.wszCharset), - #ifdef DUMP_CP_INFO +#ifdef DUMP_CP_INFO "%s != %s\n", wine_dbgstr_w(cpinfo[i].wszBodyCharset), wine_dbgstr_w(mcsi.wszCharset)); - #else +#else "wszBodyCharset mismatch\n"); - #endif +#endif if (0) { @@ -815,8 +815,8 @@ static void test_GetRfc1766FromLcid(IMultiLanguage2 *iML2) hr = IMultiLanguage2_GetRfc1766FromLcid(iML2, lcid, &rfcstr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok_w2("Expected \"%s\", got \"%s\"n", kok, rfcstr); + SysFreeString(rfcstr); } - SysFreeString(rfcstr); } static void test_IMultiLanguage2_ConvertStringFromUnicode(IMultiLanguage2 *iML2) diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 1fe6cbf3340..33b2e56eeb1 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -31,6 +31,13 @@ #define MINSPERHOUR 60 #define HOURSPERDAY 24 +static void test_ctime(void) +{ + time_t badtime = -1; + char* ret; + ret = ctime(&badtime); + ok(ret == NULL, "expected ctime to return NULL, got %s\n", ret); +} static void test_gmtime(void) { time_t gmt = (time_t)NULL; @@ -249,6 +256,7 @@ static void test_wstrtime(void) START_TEST(time) { + test_ctime(); test_gmtime(); test_mktime(); test_localtime(); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 69762e07724..ba4e95c7e3d 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -447,7 +447,10 @@ MSVCRT_wchar_t * CDECL MSVCRT__wasctime(const struct MSVCRT_tm *mstm) */ char * CDECL MSVCRT_ctime(const MSVCRT_time_t *time) { - return MSVCRT_asctime( MSVCRT_localtime(time) ); + struct MSVCRT_tm *t; + t = MSVCRT_localtime( time ); + if (!t) return NULL; + return MSVCRT_asctime( t ); } /********************************************************************* diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 646df914f2b..62058d1ea83 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -55,7 +55,12 @@ typedef struct _saxreader struct IVBSAXContentHandler *vbcontentHandler; struct ISAXErrorHandler *errorHandler; struct IVBSAXErrorHandler *vberrorHandler; + struct ISAXLexicalHandler *lexicalHandler; + struct IVBSAXLexicalHandler *vblexicalHandler; + struct ISAXDeclHandler *declHandler; + struct IVBSAXDeclHandler *vbdeclHandler; xmlSAXHandler sax; + BOOL isParsing; } saxreader; typedef struct _saxlocator @@ -192,6 +197,23 @@ static BSTR QName_from_xmlChar(const xmlChar *prefix, const xmlChar *name) return bstr; } +BSTR bstr_from_xmlChar_wn(const xmlChar *buf, int len) +{ + DWORD size; + LPWSTR str; + BSTR bstr; + + if(!buf) return NULL; + + size = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, NULL, 0); + str = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); + if(!str) return NULL; + MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, str, size); + bstr = SysAllocStringLen(str, size); + HeapFree(GetProcessHeap(), 0, str); + return bstr; +} + static void format_error_message_from_id(saxlocator *This, HRESULT hr) { xmlStopParser(This->pParserCtxt); @@ -1171,8 +1193,6 @@ static void libxmlCharacters( chEnd = This->lastCur+len; while(*chEnd != '<') chEnd++; - Chars = bstr_from_xmlChar(ch); - lastCurCopy = This->lastCur; columnCopy = This->column; lineCopy = This->line; @@ -1190,7 +1210,7 @@ static void libxmlCharacters( end++; } - Chars = bstr_from_xmlChar(This->lastCur); + Chars = bstr_from_xmlChar_wn(This->lastCur, end-This->lastCur+2); if(*end == '\r' && *(end+1) == '\n') { @@ -1664,8 +1684,10 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz locator->pParserCtxt->sax = &locator->saxreader->sax; locator->pParserCtxt->userData = locator; + This->isParsing = TRUE; if(xmlParseDocument(locator->pParserCtxt)) hr = E_FAIL; else hr = locator->ret; + This->isParsing = FALSE; if(locator->pParserCtxt) { @@ -1702,6 +1724,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt return E_FAIL; } + This->isParsing = TRUE; while(1) { hr = IStream_Read(stream, data, sizeof(data), &dataRead); @@ -1721,6 +1744,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt break; } } + This->isParsing = FALSE; locator->pParserCtxt->sax = NULL; xmlFreeParserCtxt(locator->pParserCtxt); @@ -1975,6 +1999,143 @@ static HRESULT WINAPI internal_parseURL( return S_OK; } +static HRESULT WINAPI internal_putProperty( + saxreader* This, + const WCHAR *pProp, + VARIANT value, + BOOL vbInterface) +{ + static const WCHAR wszCharset[] = { + 'c','h','a','r','s','e','t',0 + }; + static const WCHAR wszDeclarationHandler[] = { + 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', + 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', + 'd','e','c','l','a','r','a','t','i','o','n', + '-','h','a','n','d','l','e','r',0 + }; + static const WCHAR wszDomNode[] = { + 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', + 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', + 'd','o','m','-','n','o','d','e',0 + }; + static const WCHAR wszInputSource[] = { + 'i','n','p','u','t','-','s','o','u','r','c','e',0 + }; + static const WCHAR wszLexicalHandler[] = { + 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', + 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', + 'l','e','x','i','c','a','l','-','h','a','n','d','l','e','r',0 + }; + static const WCHAR wszMaxElementDepth[] = { + 'm','a','x','-','e','l','e','m','e','n','t','-','d','e','p','t','h',0 + }; + static const WCHAR wszMaxXMLSize[] = { + 'm','a','x','-','x','m','l','-','s','i','z','e',0 + }; + static const WCHAR wszSchemaDeclarationHandler[] = { + 's','c','h','e','m','a','-', + 'd','e','c','l','a','r','a','t','i','o','n','-', + 'h','a','n','d','l','e','r',0 + }; + static const WCHAR wszXMLDeclEncoding[] = { + 'x','m','l','d','e','c','l','-','e','n','c','o','d','i','n','g',0 + }; + static const WCHAR wszXMLDeclStandalone[] = { + 'x','m','l','d','e','c','l', + '-','s','t','a','n','d','a','l','o','n','e',0 + }; + static const WCHAR wszXMLDeclVersion[] = { + 'x','m','l','d','e','c','l','-','v','e','r','s','i','o','n',0 + }; + + FIXME("(%p)->(%s): semi-stub\n", This, debugstr_w(pProp)); + + if(!memcmp(pProp, wszCharset, sizeof(wszCharset))) + return E_NOTIMPL; + + if(!memcmp(pProp, wszDeclarationHandler, sizeof(wszDeclarationHandler))) + { + if(This->isParsing) return E_FAIL; + + if(V_UNKNOWN(&value)) + { + if(vbInterface) + IVBSAXDeclHandler_AddRef((IVBSAXDeclHandler*)V_UNKNOWN(&value)); + else + ISAXDeclHandler_AddRef((ISAXDeclHandler*)V_UNKNOWN(&value)); + } + if((vbInterface && This->vbdeclHandler) + || (!vbInterface && This->declHandler)) + { + if(vbInterface) + IVBSAXDeclHandler_Release(This->vbdeclHandler); + else + ISAXDeclHandler_Release(This->declHandler); + } + if(vbInterface) + This->vbdeclHandler = (IVBSAXDeclHandler*)V_UNKNOWN(&value); + else + This->declHandler = (ISAXDeclHandler*)V_UNKNOWN(&value); + return S_OK; + } + + if(!memcmp(pProp, wszDomNode, sizeof(wszDomNode))) + return E_FAIL; + + if(!memcmp(pProp, wszInputSource, sizeof(wszInputSource))) + return E_NOTIMPL; + + if(!memcmp(pProp, wszLexicalHandler, sizeof(wszLexicalHandler))) + { + if(This->isParsing) return E_FAIL; + + if(V_UNKNOWN(&value)) + { + if(vbInterface) + IVBSAXLexicalHandler_AddRef( + (IVBSAXLexicalHandler*)V_UNKNOWN(&value)); + else + ISAXLexicalHandler_AddRef( + (ISAXLexicalHandler*)V_UNKNOWN(&value)); + } + if((vbInterface && This->vblexicalHandler) + || (!vbInterface && This->lexicalHandler)) + { + if(vbInterface) + IVBSAXLexicalHandler_Release(This->vblexicalHandler); + else + ISAXLexicalHandler_Release(This->lexicalHandler); + } + if(vbInterface) + This->vblexicalHandler = (IVBSAXLexicalHandler*)V_UNKNOWN(&value); + else + This->lexicalHandler = (ISAXLexicalHandler*)V_UNKNOWN(&value); + return S_OK; + } + + if(!memcmp(pProp, wszMaxElementDepth, sizeof(wszMaxElementDepth))) + return E_NOTIMPL; + + if(!memcmp(pProp, wszMaxXMLSize, sizeof(wszMaxXMLSize))) + return E_NOTIMPL; + + if(!memcmp(pProp, wszSchemaDeclarationHandler, + sizeof(wszSchemaDeclarationHandler))) + return E_NOTIMPL; + + if(!memcmp(pProp, wszXMLDeclEncoding, sizeof(wszXMLDeclEncoding))) + return E_FAIL; + + if(!memcmp(pProp, wszXMLDeclStandalone, sizeof(wszXMLDeclStandalone))) + return E_FAIL; + + if(!memcmp(pProp, wszXMLDeclVersion, sizeof(wszXMLDeclVersion))) + return E_FAIL; + + return E_INVALIDARG; +} + /*** IVBSAXXMLReader interface ***/ /*** IUnknown methods ***/ static HRESULT WINAPI saxxmlreader_QueryInterface(IVBSAXXMLReader* iface, REFIID riid, void **ppvObject) @@ -2036,6 +2197,18 @@ static ULONG WINAPI saxxmlreader_Release( if(This->vberrorHandler) IVBSAXErrorHandler_Release(This->vberrorHandler); + if(This->lexicalHandler) + ISAXLexicalHandler_Release(This->lexicalHandler); + + if(This->vblexicalHandler) + IVBSAXLexicalHandler_Release(This->vblexicalHandler); + + if(This->declHandler) + ISAXDeclHandler_Release(This->declHandler); + + if(This->vbdeclHandler) + IVBSAXDeclHandler_Release(This->vbdeclHandler); + HeapFree( GetProcessHeap(), 0, This ); } @@ -2164,9 +2337,7 @@ static HRESULT WINAPI saxxmlreader_putProperty( VARIANT value) { saxreader *This = impl_from_IVBSAXXMLReader( iface ); - - FIXME("(%p)->(%s) stub\n", This, debugstr_w(pProp)); - return E_NOTIMPL; + return internal_putProperty(This, pProp, value, TRUE); } static HRESULT WINAPI saxxmlreader_get_entityResolver( @@ -2379,9 +2550,7 @@ static HRESULT WINAPI isaxxmlreader_putProperty( VARIANT value) { saxreader *This = impl_from_ISAXXMLReader( iface ); - return IVBSAXXMLReader_putProperty( - (IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl, - pProp, value); + return internal_putProperty(This, pProp, value, FALSE); } static HRESULT WINAPI isaxxmlreader_getEntityResolver( @@ -2546,6 +2715,11 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) reader->vbcontentHandler = NULL; reader->errorHandler = NULL; reader->vberrorHandler = NULL; + reader->lexicalHandler = NULL; + reader->vblexicalHandler = NULL; + reader->declHandler = NULL; + reader->vbdeclHandler = NULL; + reader->isParsing = FALSE; memset(&reader->sax, 0, sizeof(xmlSAXHandler)); reader->sax.initialized = XML_SAX2_MAGIC; diff --git a/dlls/oleaut32/recinfo.c b/dlls/oleaut32/recinfo.c index 61f65543975..a4da4d374fb 100644 --- a/dlls/oleaut32/recinfo.c +++ b/dlls/oleaut32/recinfo.c @@ -59,7 +59,7 @@ static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt) #define CASE_COPY(x) \ case VT_ ## x: \ - V_ ## x(pvar) = *(typeof(V_ ## x(pvar))*)src; \ + memcpy(&V_ ## x(pvar), src, sizeof(V_ ## x(pvar))); \ break switch(vt) { @@ -106,7 +106,7 @@ static HRESULT copy_from_variant(VARIANT *src, void *dest, enum VARENUM vt) #define CASE_COPY(x) \ case VT_ ## x: \ - *(typeof(V_ ## x(&var))*)dest = V_ ## x(&var); \ + memcpy(dest, &V_ ## x(&var), sizeof(V_ ## x(&var))); \ break switch(vt) { diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 649d7e7e3b6..8274721a8b2 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -323,11 +324,26 @@ static void test_EM_GETLINE(void) !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=1\n"); else { + /* Prepare hex strings of buffers to dump on failure. */ + char expectedbuf[1024]; + char resultbuf[1024]; + int j; + expectedbuf[0] = '\0'; + for (j = 0; j < 32; j++) + sprintf(expectedbuf+strlen(expectedbuf), "%02x", dest[j] & 0xFF); + resultbuf[0] = '\0'; + for (j = 0; j < expected_bytes_written; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", gl[i].text[j] & 0xFF); + for (; j < 32; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", origdest[j] & 0xFF); + ok(!strncmp(dest, gl[i].text, expected_bytes_written), - "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n", + i, expected_bytes_written, expectedbuf, resultbuf); ok(!strncmp(dest + expected_bytes_written, origdest + expected_bytes_written, nBuf - expected_bytes_written), - "%d: expected_bytes_written=%d\n", i, expected_bytes_written); + "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n", + i, expected_bytes_written, expectedbuf, resultbuf); } } diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 80e5b81f515..3be736d1edc 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -861,7 +861,10 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, if (pointer_id) pointer_needs_unmarshaling = 1; else + { + *pPointer = NULL; pointer_needs_unmarshaling = 0; + } break; case RPC_FC_FP: pointer_id = NDR_LOCAL_UINT32_READ(Buffer); diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 0eabe507251..e4c4ceac8b4 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -2005,9 +2005,10 @@ static void test_menu_hilitemenuitem( void ) static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type, UINT checked_state) { - UINT i, count; + INT i, count; count = GetMenuItemCount(hmenu); + ok (count != -1, "GetMenuItemCount returned -1\n"); for (i = 0; i < count; i++) { @@ -2148,7 +2149,7 @@ static void test_menu_resource_layout(void) { MF_SEPARATOR, MF_GRAYED|MF_DISABLED, 8, "" } }; HMENU hmenu; - UINT count, i; + INT count, i; BOOL ret; hmenu = LoadMenuIndirect(&menu_template); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a950c1f7155..6296797ddad 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -614,6 +614,7 @@ enum x11drv_atoms XATOM__NET_WM_WINDOW_TYPE_DIALOG, XATOM__NET_WM_WINDOW_TYPE_NORMAL, XATOM__NET_WM_WINDOW_TYPE_UTILITY, + XATOM__NET_WORKAREA, XATOM__XEMBED_INFO, XATOM_XdndAware, XATOM_XdndEnter, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 25a86f013b9..fc9996af5c7 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -150,6 +150,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_NET_WM_WINDOW_TYPE_DIALOG", "_NET_WM_WINDOW_TYPE_NORMAL", "_NET_WM_WINDOW_TYPE_UTILITY", + "_NET_WORKAREA", "_XEMBED_INFO", "XdndAware", "XdndEnter", diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index f68cf2aa8d6..f3af0c3172d 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -65,6 +65,25 @@ static inline int monitor_to_index( HMONITOR handle ) return index - 1; } +static void query_work_area( RECT *rc_work ) +{ + Atom type; + int format; + unsigned long count, remaining; + long *work_area; + + if (!XGetWindowProperty( gdi_display, DefaultRootWindow(gdi_display), x11drv_atom(_NET_WORKAREA), 0, + ~0, False, XA_CARDINAL, &type, &format, &count, + &remaining, (unsigned char **)&work_area )) + { + if (type == XA_CARDINAL && format == 32 && count >= 4) + { + SetRect( rc_work, work_area[0], work_area[1], + work_area[0] + work_area[2], work_area[1] + work_area[3] ); + } + XFree( work_area ); + } +} #ifdef SONAME_LIBXINERAMA @@ -92,10 +111,13 @@ static int query_screens(void) { int i, count, event_base, error_base; XineramaScreenInfo *screens; + RECT rc_work; if (!monitors) /* first time around */ load_xinerama(); + query_work_area( &rc_work ); + if (!pXineramaQueryExtension || !pXineramaQueryScreens || !pXineramaQueryExtension( gdi_display, &event_base, &error_base ) || !(screens = pXineramaQueryScreens( gdi_display, &count ))) return 0; @@ -111,8 +133,9 @@ static int query_screens(void) monitors[i].rcMonitor.top = screens[i].y_org; monitors[i].rcMonitor.right = screens[i].x_org + screens[i].width; monitors[i].rcMonitor.bottom = screens[i].y_org + screens[i].height; - monitors[i].rcWork = monitors[i].rcMonitor; monitors[i].dwFlags = 0; + if (!IntersectRect( &monitors[i].rcWork, &rc_work, &monitors[i].rcMonitor )) + monitors[i].rcWork = monitors[i].rcMonitor; /* FIXME: using the same device name for all monitors for now */ lstrcpyW( monitors[i].szDevice, default_monitor.szDevice ); } @@ -147,6 +170,8 @@ void xinerama_init( unsigned int width, unsigned int height ) if (root_window != DefaultRootWindow( gdi_display ) || !query_screens()) { default_monitor.rcWork = default_monitor.rcMonitor = rect; + if (root_window == DefaultRootWindow( gdi_display )) + query_work_area( &default_monitor.rcWork ); nb_monitors = 1; monitors = &default_monitor; } @@ -159,8 +184,9 @@ void xinerama_init( unsigned int width, unsigned int height ) { OffsetRect( &monitors[i].rcMonitor, rect.left, rect.top ); OffsetRect( &monitors[i].rcWork, rect.left, rect.top ); - TRACE( "monitor %p: %s%s\n", + TRACE( "monitor %p: %s work %s%s\n", index_to_monitor(i), wine_dbgstr_rect(&monitors[i].rcMonitor), + wine_dbgstr_rect(&monitors[i].rcWork), (monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? " (primary)" : "" ); } diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 6166ff8673c..ea1d294683e 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -2478,6 +2478,12 @@ BOOL WINAPI InternetTimeFromSystemTimeA( const SYSTEMTIME* time, DWORD format, L TRACE( "%p 0x%08x %p 0x%08x\n", time, format, string, size ); + if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string)) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + ret = InternetTimeFromSystemTimeW( time, format, stringW, sizeof(stringW) ); if (ret) WideCharToMultiByte( CP_ACP, 0, stringW, -1, string, size, NULL, NULL ); @@ -2495,10 +2501,14 @@ BOOL WINAPI InternetTimeFromSystemTimeW( const SYSTEMTIME* time, DWORD format, L TRACE( "%p 0x%08x %p 0x%08x\n", time, format, string, size ); - if (!time || !string) return FALSE; + if (!time || !string || format != INTERNET_RFC1123_FORMAT) + return FALSE; - if (format != INTERNET_RFC1123_FORMAT || size < INTERNET_RFC1123_BUFSIZE * sizeof(WCHAR)) + if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string)) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); return FALSE; + } sprintfW( string, date, WININET_wkday[time->wDayOfWeek], diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 1c52f270499..b6677b60127 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -105,10 +105,6 @@ static CHAR status_string[MAX_INTERNET_STATUS][MAX_STATUS_NAME]; static HANDLE hCompleteEvent; static INTERNET_STATUS_CALLBACK (WINAPI *pInternetSetStatusCallbackA)(HINTERNET ,INTERNET_STATUS_CALLBACK); -static BOOL (WINAPI *pInternetTimeFromSystemTimeA)(CONST SYSTEMTIME *,DWORD ,LPSTR ,DWORD); -static BOOL (WINAPI *pInternetTimeFromSystemTimeW)(CONST SYSTEMTIME *,DWORD ,LPWSTR ,DWORD); -static BOOL (WINAPI *pInternetTimeToSystemTimeA)(LPCSTR ,SYSTEMTIME *,DWORD); -static BOOL (WINAPI *pInternetTimeToSystemTimeW)(LPCWSTR ,SYSTEMTIME *,DWORD); static VOID WINAPI callback( @@ -783,91 +779,6 @@ static void InternetOpenUrlA_test(void) InternetCloseHandle(myhinternet); } -static void InternetTimeFromSystemTimeA_test(void) -{ - BOOL ret; - static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 }; - char string[INTERNET_RFC1123_BUFSIZE]; - static const char expect[] = "Fri, 07 Jan 2005 12:06:35 GMT"; - - ret = pInternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) ); - ok( ret, "InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() ); - - ok( !memcmp( string, expect, sizeof(expect) ), - "InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() ); -} - -static void InternetTimeFromSystemTimeW_test(void) -{ - BOOL ret; - static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 }; - WCHAR string[INTERNET_RFC1123_BUFSIZE + 1]; - static const WCHAR expect[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ', - '1','2',':','0','6',':','3','5',' ','G','M','T',0 }; - - ret = pInternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) ); - ok( ret, "InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() ); - - ok( !memcmp( string, expect, sizeof(expect) ), - "InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() ); -} - -static void InternetTimeToSystemTimeA_test(void) -{ - BOOL ret; - SYSTEMTIME time; - static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 }; - static const char string[] = "Fri, 07 Jan 2005 12:06:35 GMT"; - static const char string2[] = " fri 7 jan 2005 12 06 35"; - - ret = pInternetTimeToSystemTimeA( string, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); - ok( !memcmp( &time, &expect, sizeof(expect) ), - "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeA( string2, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); - ok( !memcmp( &time, &expect, sizeof(expect) ), - "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); -} - -static void InternetTimeToSystemTimeW_test(void) -{ - BOOL ret; - SYSTEMTIME time; - static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 }; - static const WCHAR string[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ', - '1','2',':','0','6',':','3','5',' ','G','M','T',0 }; - static const WCHAR string2[] = { ' ','f','r','i',' ','7',' ','j','a','n',' ','2','0','0','5',' ', - '1','2',' ','0','6',' ','3','5',0 }; - static const WCHAR string3[] = { 'F','r',0 }; - - ret = pInternetTimeToSystemTimeW( NULL, NULL, 0 ); - ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( NULL, &time, 0 ); - ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( string, NULL, 0 ); - ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( string, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( string, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); - ok( !memcmp( &time, &expect, sizeof(expect) ), - "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( string2, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); - ok( !memcmp( &time, &expect, sizeof(expect) ), - "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); - - ret = pInternetTimeToSystemTimeW( string3, &time, 0 ); - ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); -} - static void HttpSendRequestEx_test(void) { HINTERNET hSession; @@ -2157,10 +2068,6 @@ START_TEST(http) HMODULE hdll; hdll = GetModuleHandleA("wininet.dll"); pInternetSetStatusCallbackA = (void*)GetProcAddress(hdll, "InternetSetStatusCallbackA"); - pInternetTimeFromSystemTimeA = (void*)GetProcAddress(hdll, "InternetTimeFromSystemTimeA"); - pInternetTimeFromSystemTimeW = (void*)GetProcAddress(hdll, "InternetTimeFromSystemTimeW"); - pInternetTimeToSystemTimeA = (void*)GetProcAddress(hdll, "InternetTimeToSystemTimeA"); - pInternetTimeToSystemTimeW = (void*)GetProcAddress(hdll, "InternetTimeToSystemTimeW"); if (!pInternetSetStatusCallbackA) skip("skipping the InternetReadFile tests\n"); @@ -2175,15 +2082,6 @@ START_TEST(http) InternetOpenRequest_test(); test_http_cache(); InternetOpenUrlA_test(); - if (!pInternetTimeFromSystemTimeA) - skip("skipping the InternetTime tests\n"); - else - { - InternetTimeFromSystemTimeA_test(); - InternetTimeFromSystemTimeW_test(); - InternetTimeToSystemTimeA_test(); - InternetTimeToSystemTimeW_test(); - } HttpSendRequestEx_test(); HttpHeaders_test(); test_http_connection(); diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index 14adc43be33..7edb6bc7eea 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -27,6 +27,11 @@ #include "wine/test.h" +static BOOL (WINAPI *pInternetTimeFromSystemTimeA)(CONST SYSTEMTIME *,DWORD ,LPSTR ,DWORD); +static BOOL (WINAPI *pInternetTimeFromSystemTimeW)(CONST SYSTEMTIME *,DWORD ,LPWSTR ,DWORD); +static BOOL (WINAPI *pInternetTimeToSystemTimeA)(LPCSTR ,SYSTEMTIME *,DWORD); +static BOOL (WINAPI *pInternetTimeToSystemTimeW)(LPCWSTR ,SYSTEMTIME *,DWORD); + /* ############################### */ static void test_InternetCanonicalizeUrlA(void) @@ -362,13 +367,133 @@ static void test_version(void) ok(version.dwMinorVersion == 2, "dwMinorVersion=%d, expected 2\n", version.dwMinorVersion); } +static void InternetTimeFromSystemTimeA_test(void) +{ + BOOL ret; + static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 }; + char string[INTERNET_RFC1123_BUFSIZE]; + static const char expect[] = "Fri, 07 Jan 2005 12:06:35 GMT"; + DWORD error; + + ret = pInternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) ); + ok( ret, "InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() ); + + ok( !memcmp( string, expect, sizeof(expect) ), + "InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() ); + + SetLastError(0xdeadbeef); + ret = pInternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, 0 ); + error = GetLastError(); + ok( !ret, "InternetTimeFromSystemTimeA should have returned FALSE\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, + "InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %u\n", + error ); +} + +static void InternetTimeFromSystemTimeW_test(void) +{ + BOOL ret; + static const SYSTEMTIME time = { 2005, 1, 5, 7, 12, 6, 35, 0 }; + WCHAR string[INTERNET_RFC1123_BUFSIZE + 1]; + static const WCHAR expect[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ', + '1','2',':','0','6',':','3','5',' ','G','M','T',0 }; + DWORD error; + + ret = pInternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) ); + ok( ret, "InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() ); + + ok( !memcmp( string, expect, sizeof(expect) ), + "InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() ); + + SetLastError(0xdeadbeef); + ret = pInternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string)/sizeof(string[0]) ); + error = GetLastError(); + ok( !ret, "InternetTimeFromSystemTimeW should have returned FALSE\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, + "InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %u\n", + error ); +} + +static void InternetTimeToSystemTimeA_test(void) +{ + BOOL ret; + SYSTEMTIME time; + static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 }; + static const char string[] = "Fri, 07 Jan 2005 12:06:35 GMT"; + static const char string2[] = " fri 7 jan 2005 12 06 35"; + + ret = pInternetTimeToSystemTimeA( string, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); + ok( !memcmp( &time, &expect, sizeof(expect) ), + "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeA( string2, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); + ok( !memcmp( &time, &expect, sizeof(expect) ), + "InternetTimeToSystemTimeA failed (%u)\n", GetLastError() ); +} + +static void InternetTimeToSystemTimeW_test(void) +{ + BOOL ret; + SYSTEMTIME time; + static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 }; + static const WCHAR string[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ', + '1','2',':','0','6',':','3','5',' ','G','M','T',0 }; + static const WCHAR string2[] = { ' ','f','r','i',' ','7',' ','j','a','n',' ','2','0','0','5',' ', + '1','2',' ','0','6',' ','3','5',0 }; + static const WCHAR string3[] = { 'F','r',0 }; + + ret = pInternetTimeToSystemTimeW( NULL, NULL, 0 ); + ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( NULL, &time, 0 ); + ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( string, NULL, 0 ); + ok( !ret, "InternetTimeToSystemTimeW succeeded (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( string, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( string, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); + ok( !memcmp( &time, &expect, sizeof(expect) ), + "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( string2, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); + ok( !memcmp( &time, &expect, sizeof(expect) ), + "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); + + ret = pInternetTimeToSystemTimeW( string3, &time, 0 ); + ok( ret, "InternetTimeToSystemTimeW failed (%u)\n", GetLastError() ); +} + /* ############################### */ START_TEST(internet) { - test_InternetCanonicalizeUrlA(); - test_InternetQueryOptionA(); - test_get_cookie(); - test_version(); - test_null(); + HMODULE hdll; + hdll = GetModuleHandleA("wininet.dll"); + pInternetTimeFromSystemTimeA = (void*)GetProcAddress(hdll, "InternetTimeFromSystemTimeA"); + pInternetTimeFromSystemTimeW = (void*)GetProcAddress(hdll, "InternetTimeFromSystemTimeW"); + pInternetTimeToSystemTimeA = (void*)GetProcAddress(hdll, "InternetTimeToSystemTimeA"); + pInternetTimeToSystemTimeW = (void*)GetProcAddress(hdll, "InternetTimeToSystemTimeW"); + + test_InternetCanonicalizeUrlA(); + test_InternetQueryOptionA(); + test_get_cookie(); + test_version(); + test_null(); + + if (!pInternetTimeFromSystemTimeA) + skip("skipping the InternetTime tests\n"); + else + { + InternetTimeFromSystemTimeA_test(); + InternetTimeFromSystemTimeW_test(); + InternetTimeToSystemTimeA_test(); + InternetTimeToSystemTimeW_test(); + } } diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c index 9b1da185a32..bf461701c3d 100644 --- a/dlls/wintab32/context.c +++ b/dlls/wintab32/context.c @@ -114,7 +114,19 @@ static inline void DUMPPACKET(WTPACKET packet) static inline void DUMPCONTEXT(LOGCONTEXTW lc) { - TRACE("context: %s, %x, %x, %x, %x, %x, %x, %x%s, %x%s, %x%s, %x, %x, %i, %i, %i, %i ,%i, %i, %i, %i, %i,%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i %i %i\n", + TRACE("Name: %s, Options: %x, Status: %x, Locks: %x, MsgBase: %x, " + "Device: %x, PktRate: %x, " + "%x%s, %x%s, %x%s, " + "BtnDnMask: %x, BtnUpMask: %x, " + "InOrgX: %i, InOrgY: %i, InOrgZ: %i, " + "InExtX: %i, InExtY: %i, InExtZ: %i, " + "OutOrgX: %i, OutOrgY: %i, OutOrgZ: %i, " + "OutExtX: %i, OutExtY: %i, OutExtZ: %i, " + "SensX: %i, SensY: %i, SensZ: %i, " + "SysMode: %i, " + "SysOrgX: %i, SysOrgY: %i, " + "SysExtX: %i, SysExtY: %i, " + "SysSensX: %i, SysSensY: %i\n", wine_dbgstr_w(lc.lcName), lc.lcOptions, lc.lcStatus, lc.lcLocks, lc.lcMsgBase, lc.lcDevice, lc.lcPktRate, lc.lcPktData, DUMPBITS(lc.lcPktData), lc.lcPktMode, DUMPBITS(lc.lcPktMode), lc.lcMoveMask, @@ -203,6 +215,8 @@ LPOPENCONTEXT AddPacketToContextQueue(LPWTPACKET packet, HWND hwnd) /* flip the Y axis */ if (ptr->context.lcOutExtY > 0) packet->pkY = ptr->context.lcOutExtY - packet->pkY; + else if (ptr->context.lcOutExtY < 0) + packet->pkY = abs(ptr->context.lcOutExtY + packet->pkY); DUMPPACKET(*packet); diff --git a/dlls/wintrust/Makefile.in b/dlls/wintrust/Makefile.in index 6f30fd65fee..f74717904b8 100644 --- a/dlls/wintrust/Makefile.in +++ b/dlls/wintrust/Makefile.in @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = wintrust.dll IMPORTLIB = wintrust IMPORTS = crypt32 user32 advapi32 kernel32 ntdll -DELAYIMPORTS = imagehlp +DELAYIMPORTS = cryptui imagehlp C_SRCS = \ asn.c \ diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index f3859338a68..a9d0857ea92 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -55,7 +55,7 @@ @ stub MsCatFreeHashTag @ stub OfficeCleanupPolicy @ stub OfficeInitializePolicy -@ stub OpenPersonalTrustDBDialog +@ stdcall OpenPersonalTrustDBDialog(ptr) @ stdcall SoftpubAuthenticode(ptr) @ stdcall SoftpubCheckCert(ptr long long long) @ stdcall SoftpubCleanup(ptr) diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c index 091c0d4e4e0..a4bfe75ec98 100644 --- a/dlls/wintrust/wintrust_main.c +++ b/dlls/wintrust/wintrust_main.c @@ -34,6 +34,7 @@ #include "objbase.h" #include "winuser.h" #include "cryptdlg.h" +#include "cryptuiapi.h" #include "wintrust_priv.h" #include "wine/debug.h" @@ -1057,3 +1058,27 @@ BOOL WINAPI WINTRUST_AddPrivData(CRYPT_PROVIDER_DATA *data, SetLastError(ERROR_OUTOFMEMORY); return ret; } + +/*********************************************************************** + * OpenPersonalTrustDBDialog (WINTRUST.@) + * + * Opens the certificate manager dialog, showing only the stores that + * contain trusted software publishers. + * + * PARAMS + * hwnd [I] handle of parent window + * + * RETURNS + * TRUE if the dialog could be opened, FALSE if not. + */ +BOOL WINAPI OpenPersonalTrustDBDialog(HWND hwnd) +{ + CRYPTUI_CERT_MGR_STRUCT uiCertMgr; + + uiCertMgr.dwSize = sizeof(uiCertMgr); + uiCertMgr.hwndParent = hwnd; + uiCertMgr.dwFlags = CRYPTUI_CERT_MGR_PUBLISHER_TAB; + uiCertMgr.pwszTitle = NULL; + uiCertMgr.pszInitUsageOID = NULL; + return CryptUIDlgCertMgr(&uiCertMgr); +} diff --git a/include/dwmapi.h b/include/dwmapi.h index 967efedc583..710e3f4dde7 100644 --- a/include/dwmapi.h +++ b/include/dwmapi.h @@ -32,6 +32,8 @@ extern "C" { DECLARE_HANDLE(HTHUMBNAIL); DWMAPI DwmEnableComposition(UINT); +DWMAPI DwmExtendFrameIntoClientArea(HWND,const MARGINS*); +DWMAPI DwmGetColorizationColor(DWORD*,BOOL); DWMAPI DwmIsCompositionEnabled(BOOL*); DWMAPI DwmSetWindowAttribute(HWND, DWORD, LPCVOID, DWORD); DWMAPI DwmUnregisterThumbnail(HTHUMBNAIL); diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c index d028b4a877a..2b6f1760e53 100644 --- a/programs/regedit/treeview.c +++ b/programs/regedit/treeview.c @@ -57,7 +57,7 @@ static BOOL get_item_path(HWND hwndTV, HTREEITEM hItem, HKEY* phKey, LPWSTR* pKe item.mask = TVIF_PARAM; item.hItem = hItem; - if (!TreeView_GetItem(hwndTV, &item)) return FALSE; + if (!TreeView_GetItemW(hwndTV, &item)) return FALSE; if (item.lParam) { /* found root key with valid key value */ @@ -216,7 +216,7 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCWSTR sstring, int mode, item.hItem = hItem; item.pszText = keyname; item.cchTextMax = KEY_MAX_LEN; - if (!TreeView_GetItem(hwndTV, &item)) return FALSE; + if (!TreeView_GetItemW(hwndTV, &item)) return FALSE; if ((mode & SEARCH_KEYS) && match_string(keyname, sstring, mode)) { *row = -1; return TRUE; @@ -267,7 +267,10 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCWSTR sstring, int mode, if ((mode & SEARCH_CONTENT) && (type == REG_EXPAND_SZ || type == REG_SZ)) { LPWSTR buffer; buffer = HeapAlloc(GetProcessHeap(), 0, lenValue); - RegEnumValueW(hKey, i, valName, &lenName, NULL, &type, (LPBYTE)buffer, &lenValue); + if (!buffer) + break; + if (ERROR_SUCCESS != RegEnumValueW(hKey, i, NULL, NULL, NULL, &type, (LPBYTE)buffer, &lenValue)) + break; if (match_string(buffer, sstring, mode)) { HeapFree(GetProcessHeap(), 0, buffer); RegCloseKey(hKey); diff --git a/tools/wine.inf.in b/tools/wine.inf.in index ffa27c7a7cc..00e9b978d0f 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -2309,6 +2309,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,wininet.dll 11,,winmm.dll 11,,winspool.drv +11,,wintab32.dll 11,,winver.exe 11,,ws2_32.dll 11,,wsock32.dll @@ -2585,7 +2586,7 @@ HKLM,%CurrentVersionNT%\Time Zones\North Asia Standard Time,"TZI",1,5c,fe,ff,ff, HKLM,%CurrentVersionNT%\Time Zones\Pacific SA Standard Time,"Display",,"America/Santiago" HKLM,%CurrentVersionNT%\Time Zones\Pacific SA Standard Time,"Dlt",,"Pacific SA Daylight Time" HKLM,%CurrentVersionNT%\Time Zones\Pacific SA Standard Time,"Std",,"Pacific SA Standard Time" -HKLM,%CurrentVersionNT%\Time Zones\Pacific SA Standard Time,"TZI",1,f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,02,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,02,00,00,00,00,00,00,00,00,00 +HKLM,%CurrentVersionNT%\Time Zones\Pacific SA Standard Time,"TZI",1,f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,02,00,00,00,00,00,00,00,00,00 HKLM,%CurrentVersionNT%\Time Zones\Pacific Standard Time,"Display",,"America/Los_Angeles" HKLM,%CurrentVersionNT%\Time Zones\Pacific Standard Time,"Dlt",,"Pacific Daylight Time" HKLM,%CurrentVersionNT%\Time Zones\Pacific Standard Time,"Std",,"Pacific Standard Time" -- 2.11.4.GIT