Re: user32: Add check for the need to redraw static control after STM_SETIMAGE and STM_SETICON

2009-09-28 Thread Ilya Shpigor
On Saturday 26 September 2009 12:09:30 Nikolay Sivov wrote:

 ---
 + if ((style  SS_TYPEMASK) != SS_ICON) return (HICON)-1;
 ...
 + if ((style  SS_TYPEMASK) != SS_BITMAP) return (HBITMAP)-1;
 ...
 + if ((style  SS_TYPEMASK) != SS_ENHMETAFILE) return (HENHMETAFILE)-1;
 ---

 Add tests for that please (MSDN tells about 0 return value on error).

Yes, MSDN tells about 0. The -1 value is used for detecting the errors inside 
Wine and blocking the static controls redrawing. Then the 0 value is returned 
to application:

-        STATIC_TryPaintFcn( hwnd, full_style );
+        if (lResult != -1)
+            STATIC_TryPaintFcn( hwnd, full_style );
+        else
+            lResult = 0;

Tests for checking STM_SETIMAGE and STM_SETICON messages processing had been 
sent above:

[TRY 3] user32/tests: Add tests for STM_SETIMAGE and STM_SETICON message 
processing

Is there a better way to block this redrawing?

-- 
Best regards,
Ilya Shpigor.




Re: user32: Add check for the need to redraw static control afterSTM_SETIMAGE and STM_SETICON

2009-09-28 Thread Dmitry Timoshkov

Ilya Shpigor shpi...@etersoft.ru wrote:

Yes, MSDN tells about 0. The -1 value is used for detecting the errors inside 
Wine and blocking the static controls redrawing. Then the 0 value is returned 
to application:


- STATIC_TryPaintFcn( hwnd, full_style );
+ if (lResult != -1)
+ STATIC_TryPaintFcn( hwnd, full_style );
+ else
+ lResult = 0;

Tests for checking STM_SETIMAGE and STM_SETICON messages processing had been 
sent above:


[TRY 3] user32/tests: Add tests for STM_SETIMAGE and STM_SETICON message 
processing


Is there a better way to block this redrawing?


First thing to do (as usual) is to add the test to show the drawing
behaviour.

--
Dmitry.





Re: comctl32/tests: Fix monthcal test on NT4

2009-09-28 Thread Nikolay Sivov

Ge van Geldorp wrote:

Ignore MCHT_TITLEBK, title elements might be adjacent without any
background in between.

Changelog:
  comctl32/tests: Fix monthcal test on NT4

---
 dlls/comctl32/tests/monthcal.c |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)
  

Hi, Ge.

This one interfere with a mine, sent yesterday:

http://www.winehq.org/pipermail/wine-patches/2009-September/078955.html

Could you wait a bit? I hope this could fix some failures.




Re: comctl32/tests: Fix monthcal test on NT4

2009-09-28 Thread Greg Geldorp
Hi Nikolay,

 Ge van Geldorp wrote:
  Changelog:
comctl32/tests: Fix monthcal test on NT4
 Hi, Ge.

 This one interfere with a mine, sent yesterday:

 http://www.winehq.org/pipermail/wine-patches/2009-September/078955.html

 Could you wait a bit? I hope this could fix some failures.

Sure. I'll resend after your patch is in (if my fix is still needed).

Ge.





Re: [PATCH 06/12] d3d10: Implement ID3D10EffectType::GetMemberName().

2009-09-28 Thread Henri Verbeet
  static LPCSTR STDMETHODCALLTYPE 
 d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
  {
 -FIXME(iface %p, index %u stub!\n, iface, index);
 +struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;

 -return NULL;
 +TRACE(iface %p, index %u\n, iface, index);
 +
 +if(index = This-member_count) return NULL;
 +
 +return This-members[index].name;
  }

You can't do this yet, it needs to work for types created by
parse_fx10_type() as well. The same goes for patches 7-11. Patches 1-5
look ok to me, and can stand on their own.




Re: [PATCH 12/12] d3d10/tests: Add test_effect_constant_buffer_type test.

2009-09-28 Thread Henri Verbeet
2009/9/28 Rico Schüller kgbric...@web.de:
 +ID3D10Effect* effect;
I'd prefer it if that was written as ID3D10Effect *effect;

 +ok(SUCCEEDED(hr), ID3D10EffectType::GetDesc failed!\n);
Please print the actual error code as well.

 +ok(type_desc.Elements == 0, Elements is %i, expected 0\n, 
 type_desc.Elements);
 +ok(type_desc.Members == 2, Members is %i, expected 2\n, 
 type_desc.Members);
 +ok(type_desc.Rows == 0, Rows is %i, expected 0\n, type_desc.Rows);
 +ok(type_desc.Columns == 0, Columns is %i, expected 0\n, 
 type_desc.Columns);
These are unsigned variables.

 +string = type-lpVtbl-GetMemberName(type, 0);
 +ok(strcmp(string, f1) == 0, GetMemberName(0) is \%s\, expected 
 \f1\\n, string);
You should probably use wine_dbgstr_a() for this.




Re: ole32/tests: fix clipboard tests on Windows

2009-09-28 Thread Alexandre Julliard
Ge van Geldorp ggeld...@vmware.com writes:

 @@ -417,18 +417,23 @@ static HRESULT 
 DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj)
  InitFormatEtc(obj-fmtetc[1], cf_stream, TYMED_ISTREAM);
  InitFormatEtc(obj-fmtetc[2], cf_storage, TYMED_ISTORAGE);
  InitFormatEtc(obj-fmtetc[3], cf_another, 
 TYMED_ISTORAGE|TYMED_ISTREAM|TYMED_HGLOBAL);
 -memset(dm, 0, sizeof(dm));
 -dm.dmSize = sizeof(dm);
 -dm.dmDriverExtra = 0;
 -lstrcpyW(dm.dmDeviceName, device_name);
 -obj-fmtetc[3].ptd = HeapAlloc(GetProcessHeap(), 0, 
 FIELD_OFFSET(DVTARGETDEVICE, tdData) + sizeof(device_name) + dm.dmSize + 
 dm.dmDriverExtra);
 -obj-fmtetc[3].ptd-tdSize = FIELD_OFFSET(DVTARGETDEVICE, tdData) + 
 sizeof(device_name) + dm.dmSize + dm.dmDriverExtra;
 -obj-fmtetc[3].ptd-tdDriverNameOffset = FIELD_OFFSET(DVTARGETDEVICE, 
 tdData);
 -obj-fmtetc[3].ptd-tdDeviceNameOffset = 0;
 -obj-fmtetc[3].ptd-tdPortNameOffset   = 0;
 -obj-fmtetc[3].ptd-tdExtDevmodeOffset = 
 obj-fmtetc[3].ptd-tdDriverNameOffset + sizeof(device_name);
 -lstrcpyW((WCHAR*)obj-fmtetc[3].ptd-tdData, device_name);
 -memcpy(obj-fmtetc[3].ptd-tdData + sizeof(device_name), dm, dm.dmSize 
 + dm.dmDriverExtra);
 +if (! broken(TRUE))  /* Windows messes up ptd when doing 
 OleGetClipboard() */
 +{

If that case is really unconditionally broken on Windows it doesn't make
sense to test it at all.

-- 
Alexandre Julliard
julli...@winehq.org




Re: user32: Add check for the need to redraw static control afterSTM_SETIMAGE and STM_SETICON

2009-09-28 Thread Ilya Shpigor

 First thing to do (as usual) is to add the test to show the drawing
 behaviour.

Ok. I will make TRY 4 of tests.

-- 
Best regards,
Ilya Shpigor.




Re: d3d9: Don't release the parent device before destroying its children

2009-09-28 Thread Allan Tong
On Mon, Sep 28, 2009 at 10:51 AM, Henri Verbeet hverb...@gmail.com wrote:
 2009/9/28 Allan Tong acton...@gmail.com:
 Note that this patch only changes d3d9.

 Could you write one for d3d8 as well? Otherwise I'll send one tomorrow.

Will do.

 - Allan




Re: comctl32: Send the parent notification after the Wine has set the tooltip position (bug #14336)

2009-09-28 Thread Nikolay Sivov

Could you please add a test for that?




Re: comctl32/tests: Fix monthcal test on NT4

2009-09-28 Thread Nikolay Sivov

Greg Geldorp wrote:

Hi Nikolay,

  

Ge van Geldorp wrote:


Changelog:
  comctl32/tests: Fix monthcal test on NT4
  

Hi, Ge.

This one interfere with a mine, sent yesterday:

http://www.winehq.org/pipermail/wine-patches/2009-September/078955.html

Could you wait a bit? I hope this could fix some failures.



Sure. I'll resend after your patch is in (if my fix is still needed).

Ge.
  
This patch wasn't committed for some reason, I'll try again with it. The 
main problem with this is that we are creating control of size that 
leads to display two calendars, and builtin doesn't support this yet. 
First of all we need to reduce control size to get a single calendar.






Patch for [Bug 14222] RpcBindingSetAuthInfo(Ex) fails with RPC_C_AUTHN_GSS_NEGOTIATE

2009-09-28 Thread Stefan Kuhr
Hello everyone,

please find attached a patch for Bug 14222. IIRC I sent a similar
patch a year ago or so and never received feedback why it was
rejected. Austin encouraged me to send it again, so please if it is
unacceptable, let me know why.


The patch will make RPC clients work that are written for Windows 2000
(and later), where the negotiate provider performs an automatic
fallback to NTLM, if Kerberos is not possible, both in workgroup and
domain scenarios. Currently, Wine doesn't have a negotiate and a
Kerberos provider. This patch allows clients requesting Negotiate to
get the NTLM provider and will still work, even if one day negotiate
and Kerberos providers will be added to Wine.

Cheers,

-- 
Stefan


0001-Fallback-from-negotiate-to-ntlm-if-no-negotiate-prov.patch
Description: Binary data



Re: [PATCH 3/4] mshtml: Add helper function get_url_components

2009-09-28 Thread Andrew Eikum

Detlef Riekenberg wrote:

On Fr, 2009-09-25 at 15:30 -0500, Andrew Eikum wrote:

+static HRESULT get_url_components(HTMLLocation *This, URL_COMPONENTSW
*url)
+{
+const WCHAR *doc_url;



+if(!InternetCrackUrlW(doc_url, 0, 0, url)) {
+FIXME(InternetCrackUrlW failed\n);


Such a FIXME does not help to find the reason.
Dumping doc_url helps, but might add personal data to the log



Thanks for the comments.  I've resent the patches with most of your 
corrections added.


Andrew




Re: [PATCH 06/12] d3d10: Implement ID3D10EffectType::GetMemberName().

2009-09-28 Thread Rico Schüller

Am 28.09.2009 15:08, schrieb Henri Verbeet:

  static LPCSTR STDMETHODCALLTYPE 
d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
  {
-FIXME(iface %p, index %u stub!\n, iface, index);
+struct d3d10_effect_type *This = (struct d3d10_effect_type *)iface;

-return NULL;
+TRACE(iface %p, index %u\n, iface, index);
+
+if(index= This-member_count) return NULL;
+
+return This-members[index].name;
  }
 

You can't do this yet, it needs to work for types created by
parse_fx10_type() as well. The same goes for patches 7-11. Patches 1-5
look ok to me, and can stand on their own.



   

I'll improve the whole patch set.

Cheers
Rico




Review Request: Patch to selectively bind to interfaces while still allowing broadcast packets

2009-09-28 Thread Erich Hoover
Attached is a patch I have been working to fix Bug #7929 (CC 3 network does
not work).  This patch replaces interface-specific bind requests (on UDP
datagrams only) with a global bind and stores the interface index.  The
patch then uses IP_PKTINFO to set the outgoing interface and filter incoming
packets based on interface (checking against the stored interface index from
the initial bind).  Additionally, the patch peeks at packets in select and
asynchronous I/O operations to ensure that spurious wakeups do not occur
when a packet comes in from the wrong interface.

I intend to split the patch into the following pieces:
1) UDP broadcast tests (used for making sure everything works)
2) The bare essentials (storing and retrieving the interface index, and
setting/filtering the interface)
3) Ensure select does not wake up on packets with an interface mismatch
4) Ensure Async WSARecv does not wake up on packets with an interface
mismatch
5) Ensure Async ReadFile does not wake up on packets with an interface
mismatch

I would greatly appreciate any comments people have on this patch.  Thanks
so much!

Erich Hoover
ehoo...@mines.edu
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index ab88925..c70dd7a 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -155,6 +155,9 @@
 # include wsnwlink.h
 #endif
 
+#if defined(HAVE_NETINET_IN_H)  !defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS)
+#define USE_IP_PKTINFO_FILTER
+#endif
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 # define sipx_networksipx_addr.x_net
@@ -504,6 +507,32 @@ static unsigned int _get_sock_mask(SOCKET s)
 return ret;
 }
 
+/* Set and retrieve the interface for IP_PKTINFO filtered sockets */
+#ifdef USE_IP_PKTINFO_FILTER
+static void _set_sock_iface(SOCKET s, int index)
+{
+SERVER_START_REQ( set_socket_iface )
+{
+req-handle = wine_server_obj_handle( SOCKET2HANDLE(s) );
+req-iface = index;
+wine_server_call( req );
+}
+SERVER_END_REQ;
+}
+static int _get_sock_iface(SOCKET s)
+{
+int ret;
+SERVER_START_REQ( get_socket_iface )
+{
+req-handle = wine_server_obj_handle( SOCKET2HANDLE(s) );
+wine_server_call( req );
+ret = reply-iface;
+}
+SERVER_END_REQ;
+return ret;
+}
+#endif /* USE_IP_PKTINFO_FILTER */
+
 static void _sync_sock_state(SOCKET s)
 {
 /* do a dummy wineserver request in order to let
@@ -1173,12 +1202,88 @@ static void WINAPI ws2_async_apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserv
 }
 
 /***
+ *  WS2_get_pktinfo(INTERNAL)
+ *
+ * check_iface is enabled, so this is a socket that might receive broadcast
+ * packets and it is bound to a particular network interface. Therefore, we
+ * need to check the IP_PKTINFO interface to make sure that the datagram
+ * is meant for this interface and throw it out if it is not.
+ */
+#ifdef USE_IP_PKTINFO_FILTER
+struct in_pktinfo *WS2_get_pktinfo(struct msghdr *hdr)
+{
+struct cmsghdr *cmsg;
+
+for (cmsg = CMSG_FIRSTHDR(hdr); cmsg != NULL;
+ cmsg = CMSG_NXTHDR(hdr, cmsg))
+{
+if (cmsg-cmsg_level == IPPROTO_IP  cmsg-cmsg_type == IP_PKTINFO)
+return (struct in_pktinfo *)CMSG_DATA(cmsg);
+}
+WARN(Failed to get IP_PKTINFO structure for a socket with a filter enabled.\n);
+return NULL;
+}
+#endif
+
+/***
+ *  WS2_pktinfo_check_mismatch(INTERNAL)
+ *
+ * Use a MSG_PEEK to check for packets that do not match the interface
+ * set in the IP_PKTINFO filter.  This check is intended to occur
+ * before a select or an asynchronous read so that the packet does not
+ * cause a spurious wakeup.  So, if there is a mismatch then throw the
+ * packet away.
+ */
+#ifdef USE_IP_PKTINFO_FILTER
+static int WS2_pktinfo_check_mismatch( SOCKET sock, int fd )
+{
+unsigned int check_iface, optlen;
+struct msghdr hdr;
+char pktbuf[512];
+
+memset(hdr, 0, sizeof(struct msghdr));
+hdr.msg_control = pktbuf;
+hdr.msg_controllen = sizeof(pktbuf);
+hdr.msg_flags = 0;
+
+check_iface = 0;
+optlen = sizeof(check_iface);
+getsockopt(fd, IPPROTO_IP, IP_PKTINFO, (void *) check_iface, optlen);
+if (check_iface)
+{
+if ( recvmsg(fd, hdr, MSG_PEEK|MSG_DONTWAIT) != -1 )
+{
+struct in_pktinfo *pktinfo = WS2_get_pktinfo(hdr);
+int iface_index = _get_sock_iface(sock);
+
+if (pktinfo  pktinfo-ipi_ifindex != iface_index)
+{
+if ( recvmsg(fd, hdr, MSG_DONTWAIT) != -1 )
+return TRUE;
+else
+WARN(Failed to throw away packet with interface mismatch! %m\n);
+}
+}
+else
+WARN(Failed to peek at message header! %m\n);
+}
+return FALSE;
+}
+#endif
+