SV: msi: fix incorrect decoding of msi stream-names
Hi, my bad, you both and the code is obviously correct. Sorry for the bad patch. I wrongfully assumed that there was an assignment to the out-buffer at the second ch = mime2utf(); Fra: Hans Leidekker [h...@codeweavers.com] Sendt: 12. juli 2012 09:23 Til: wine-devel@winehq.org; Oleg Jakobsen Emne: Re: msi: fix incorrect decoding of msi stream-names On Wed, 2012-07-11 at 15:03 +, Oleg Jakobsen wrote: @@ -203,6 +203,7 @@ BOOL decode_streamname(LPCWSTR in, LPWSTR out) *out++ = mime2utf(ch0x3f); count++; ch = mime2utf((ch6)0x3f); + continue; } } *out++ = ch; Why is it incorrect? It seems to me that the upper bits should be written as the next character but now you are discarding them.
Re: dsound: Add detection of output format and allow a maximum of 8 channels
Andrew, I've removed the two driver edits. IAudioClient_GetMixFormat() needs an initialised client parameter which doesn't exist in DirectSoundDevice_Create(), so it can only be done after the client is initialised, which is approximately where I put the code. Also, I'm new to this, so is this the correct way to resend a patch? On Fri, Jul 13, 2012 at 11:10 PM, Andrew Eikum aei...@codeweavers.com wrote: Thanks, Donny. Nice work overall. Some comments below. On Fri, Jul 13, 2012 at 05:57:48PM +1000, Donny Yang wrote: This patch makes dsound automatically get the output format when a output device is initialised and also allows up to 8 output channels to be used for ALSA and PulseAudio. Using ALSA with over 2 channels outputs the channels in the wrong speakers with my testing but I don't know why so I can't fix that. You probably already discovered that ALSA's multi-channel support is primitive at best. You have to test each channel and hand-craft an asoundrc to match your hardware. See some more information here: http://drona.csa.iisc.ernet.in/~uday/alsamch.shtml @@ -1492,6 +1493,24 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG } else WARN(DSOUND_PrimaryCreate failed: %08x\n, hr); +hr = IAudioClient_GetMixFormat(device-client, pwfx); +if(FAILED(hr)){ +WARN(IAudioClient_GetMixFormat failed: %08x; Falling back to default output format\n, hr); +}else{ +DWORD oldPriolevel = device-priolevel; +device-priolevel = DSSCL_WRITEPRIMARY; +hr = primarybuffer_SetFormat(device, pwfx); +device-priolevel = oldPriolevel; This looks like a hack. I think it fits better in DirectSoundDevice_Create, where the default values are copied in. Is there a reason it couldn't be done there? -void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) +void put_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) { -dsb-put_aux(dsb, pos, 0, value); -dsb-put_aux(dsb, pos, 1, value); +/* XXX: Is this how Windows does this? */ +DWORD c; +for (c = 0; c dsb-device-pwfx-nChannels; ++c) +dsb-put_aux(dsb, pos, c, value); } I think this is fine. I wonder if we should skip the LOWFREQ channel, though we'd have to be careful not to affect performance too much, as this runs in a really tight loop. void mixieee32(float *src, float *dst, unsigned samples) diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 072b25a..538534d 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -642,7 +642,7 @@ DirectSoundCaptureEnumerateW( */ typedef HRESULT (*FnCreateInstance)(REFIID riid, LPVOID *ppobj); - + typedef struct { IClassFactory IClassFactory_iface; REFCLSID rclsid; @@ -702,7 +702,7 @@ static HRESULT WINAPI DSCF_CreateInstance( *ppobj = NULL; return This-pfnCreateInstance(riid, ppobj); } - + static HRESULT WINAPI DSCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); The only changes to this file are whitespace changes. I'd exclude these changes when you resend. diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 1cf6daa..68f6242 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -202,7 +202,7 @@ struct IDirectSoundBufferImpl }; float get_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) DECLSPEC_HIDDEN; -void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; +void put_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; HRESULT IDirectSoundBufferImpl_Create( DirectSoundDevice *device, @@ -288,7 +288,7 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) LONG capped_refcount_dec(LONG *ref) DECLSPEC_HIDDEN; /* duplex.c */ - + HRESULT DSOUND_FullDuplexCreate(REFIID riid, LPDIRECTSOUNDFULLDUPLEX* ppDSFD) DECLSPEC_HIDDEN; /* mixer.c */ @@ -305,7 +305,7 @@ DWORD CALLBACK DSOUND_mixthread(void *ptr) DECLSPEC_HIDDEN; void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN; /* capture.c */ - + HRESULT DSOUND_CaptureCreate(REFIID riid, LPDIRECTSOUNDCAPTURE *ppDSC) DECLSPEC_HIDDEN; HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8) DECLSPEC_HIDDEN; Likewise, more unneeded whitespace changes. diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 93e2b8d..fa6b05a 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -1544,7 +1544,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, goto exit; } if(max 8) -max = 2; +max = 8;
Re: Query MediaType of SD-Cards using IOCTL_GET_DISK_DRIVE_GEOMETRY
On Mon, Jul 16, 2012 at 07:12:59AM +0200, Eduard Hasenleithner wrote: Am 2012-07-15 22:04, schrieb GOUJON Alexandre: On 07/14/2012 09:14 PM, Eduard Hasenleithner wrote: [...] This means that the drive letter assigned for the sd card will not be returned in GetLogicalDrives(). When the symlink to the mountpoint is added manually, following output is produced: Does http://source.winehq.org/patches/data/88280 solve your GetLogicalDrives issue ? Well yes, with the patch all the drive letters are reported by GetLogicalDrives (although there are quite a lot due to the multi-slot card reader). This means that the drive letters are also visible in explorer.exe. But in explorer I still cannot have a look at the drive contents because there is no symlink in dosdevices which points to the mount point. Perhaps an issue here is that by default the card/drive is not mounted in the current udisks/udisks2 setups The mount process need to be initiated by the desktop client (either KDE, GNOME or perhaps Wine) on demand. Ciao, marcus
Re: Query MediaType of SD-Cards using IOCTL_GET_DISK_DRIVE_GEOMETRY
On 2012-07-16 09:39, Marcus Meissner wrote: On Mon, Jul 16, 2012 at 07:12:59AM +0200, Eduard Hasenleithner wrote: Am 2012-07-15 22:04, schrieb GOUJON Alexandre: Does http://source.winehq.org/patches/data/88280 solve your GetLogicalDrives issue ? Well yes, with the patch all the drive letters are reported by GetLogicalDrives (although there are quite a lot due to the multi-slot card reader). This means that the drive letters are also visible in explorer.exe. But in explorer I still cannot have a look at the drive contents because there is no symlink in dosdevices which points to the mount point. Perhaps an issue here is that by default the card/drive is not mounted in the current udisks/udisks2 setups The mount process need to be initiated by the desktop client (either KDE, GNOME or perhaps Wine) on demand. Maybe I should have mentioned it, but I'm using Ubuntu 12.04 and the SD card is mounted automatically as soon as I put it into the slot. My current hypothesis why the symlink in dosdevices is missing is that the partition is added using 'add_volume' instead of 'add_dos_device'.
Re: mshtml: Always set the URL policy in the error cases?
On Tue, 3 Jul 2012, Jacek Caban wrote: [...] It would probably be more appropriate to add assert(SUCCEEDED(hres)); after IsClassOfCategories calls, which can't fail. Ok. Would something like this be ok? It seems like this single assert() is enough to make gcc happy here. commit 2c47407d6e11ddb66050890abd5403b302c7d6c6 Author: Francois Gouget fgou...@free.fr Date: Mon Jul 16 10:33:50 2012 +0200 mshtml: Avoid returning with an unset URL policy in error cases. diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index ff349ac..f961bca 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -20,6 +20,7 @@ #include stdarg.h #include stdio.h +#include assert.h #define COBJMACROS @@ -104,9 +105,7 @@ static HRESULT confirm_safety_load(HTMLDocumentNode *This, struct CONFIRMSAFETY CATID init_catid = CATID_SafeForInitializing; hres = ICatInformation_IsClassOfCategories(This-catmgr, cs-clsid, 1, init_catid, 0, NULL); -if(FAILED(hres)) -return hres; - +assert(SUCCEEDED(hres)); *ret = hres == S_OK ? URLPOLICY_ALLOW : URLPOLICY_DISALLOW; } -- Francois Gouget fgou...@free.fr http://fgouget.free.fr/ Theory is where you know everything but nothing works. Practice is where everything works but nobody knows why. Sometimes they go hand in hand: nothing works and nobody knows why.
Re: [PATCH 1/6] jscript: Properly set Number.prototyp.constructor
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20065 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: [PATCH 5/6] jscript: Expose RegExpError constructor in global object
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20069 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: [PATCH 4/6] jscript: Properly set Error object's constructor property
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20068 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: [PATCH 3/6] jscript: Properly set Function constructor's constructor property
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20067 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: [PATCH 2/6] jscript: Properly handle constructor property for most builtin constructors
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20066 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: [PATCH 6/6] jscript: Don't set constructor property to each object instance, it belongs to their prototypes
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20070 Your paranoid android. === WNT4WSSP6 (32 bit) === No test summary line found === W2KPROSP4 (32 bit) === No test summary line found === WXPPROSP3 (32 bit) === No test summary line found === W2K3R2SESP2 (32 bit) === No test summary line found === WVISTAADM (32 bit) === No test summary line found === W7PRO (32 bit) === No test summary line found === W7PROX64 (32 bit) === No test summary line found === TEST64_W7SP1 (32 bit) === No test summary line found === W7PROX64 (64 bit) === No test summary line found === TEST64_W7SP1 (64 bit) === No test summary line found
Re: Build failure of [PATCH 5/5] kernel32/tests: Add a IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) test (try 4) ?
GOUJON Alexandre ale.gou...@gmail.com writes: Hi, My patch (http://source.winehq.org/patches/data/88072) is marked as Build failure. I tried with the latest (today) HEAD and I successfully applied it. Compilation also works for me at least on my x86 and x86_64 computers. Moreover, the Wine Test Bot tested it without any issue, see https://testbot.winehq.org/JobDetails.pl?Key=19936. I know your machine is a bit mystic. Can you show me your output to help me diagnosing your build failure ? There's nothing mystic about it, but when you are changing the Mac code, testing the build on a Mac is recommended ;-) gcc -m32 -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_NTSYSTEM_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -I/sw/include/freetype2 -I/sw/include -I/sw/include -g -O2 -o cdrom.o cdrom.c cdrom.c: In function 'DVD_ReadStructure': cdrom.c:2718: error: invalid type argument of '-' cdrom.c:2719: error: invalid type argument of '-' cdrom.c:2720: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' make[1]: *** [cdrom.o] Error 1 -- Alexandre Julliard julli...@winehq.org
Re: [PATCH 3/9] hhctrl.ocx: Centralize merging HH_WINTYPE data (resend).
Erich E. Hoover ehoo...@mymail.mines.edu writes: @@ -28,6 +28,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp); +#define HHWIN_PARAM_MASK (HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES|HHWIN_PARAM_EXSTYLES|HHWIN_PARAM_RECT\ + |HHWIN_PARAM_NAV_WIDTH|HHWIN_PARAM_SHOWSTATE|HHWIN_PARAM_INFOTYPES\ + |HHWIN_PARAM_TB_FLAGS|HHWIN_PARAM_EXPANSION|HHWIN_PARAM_TABPOS\ + |HHWIN_PARAM_TABORDER|HHWIN_PARAM_HISTORY_COUNT|HHWIN_PARAM_CUR_TAB) +#define MERGE_PARAM(s,d,o,p) ((s-fsValidMembers p) (!(d-fsValidMembers p) || o)) +#define MERGE_PROP(s,d,o,p) (s-p != 0 (d-p == 0 || o)) These macros are fairly ugly, you should be able to do without that. @@ -1752,16 +1752,16 @@ void ReleaseHelpViewer(HHInfo *info) list_remove(info-entry); /* Free allocated strings */ -heap_free(info-pszType); -heap_free(info-pszCaption); -heap_free(info-pszToc); -heap_free(info-pszIndex); -heap_free(info-pszFile); -heap_free(info-pszHome); -heap_free(info-pszJump1); -heap_free(info-pszJump2); -heap_free(info-pszUrlJump1); -heap_free(info-pszUrlJump2); +heap_free((LPVOID)info-WinType.pszType); +heap_free((LPVOID)info-WinType.pszCaption); +heap_free((LPVOID)info-WinType.pszToc); +heap_free((LPVOID)info-WinType.pszIndex); +heap_free((LPVOID)info-WinType.pszFile); +heap_free((LPVOID)info-WinType.pszHome); +heap_free((LPVOID)info-WinType.pszJump1); +heap_free((LPVOID)info-WinType.pszJump2); +heap_free((LPVOID)info-WinType.pszUrlJump1); +heap_free((LPVOID)info-WinType.pszUrlJump2); Don't do that. -- Alexandre Julliard julli...@winehq.org
Re: kernel32: Also report empty drives as available in GetLogicalDrives
Alexandre Goujon ale.gou...@gmail.com writes: --- dlls/kernel32/volume.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 8377e41..67e2eb1 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -1441,19 +1441,26 @@ DWORD WINAPI GetLogicalDrives(void) DWORD ret = 0; int i; -if (!(buffer = HeapAlloc( GetProcessHeap(), 0, strlen(config_dir) + sizeof(/dosdevices/a:) ))) +if (!(buffer = HeapAlloc( GetProcessHeap(), 0, strlen(config_dir) + sizeof(/dosdevices/a::) ))) { SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return 0; } strcpy( buffer, config_dir ); -strcat( buffer, /dosdevices/a: ); -dev = buffer + strlen(buffer) - 2; +strcat( buffer, /dosdevices/a:: ); +dev = buffer + strlen(buffer) - 3; for (i = 0; i 26; i++) { *dev = 'a' + i; +dev[2] = 0; if (!stat( buffer, st )) ret |= (1 i); +/* Windows also report empty drives as available */ +else +{ +dev[2] = ':'; +if (!stat( buffer, st )) ret |= (1 i); +} You can't do that, the device symlinks don't reflect the availability of the drive. It would have to go through the mountmgr. -- Alexandre Julliard julli...@winehq.org
Re: msi/tests: Mark some test results as broken.
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at http://testbot.winehq.org/JobDetails.pl?Key=20071 Your paranoid android. === WNT4WSSP6 (32 bit install) === install.c:6053: Test failed: Per-user icon file isn't where it's expected (C:\WINNT\Profiles\Default User\Application Data\Microsoft\Installer\{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\testicon)
Re: Query MediaType of SD-Cards using IOCTL_GET_DISK_DRIVE_GEOMETRY
On 07/16/2012 09:44 AM, Eduard Hasenleithner wrote: [...] Maybe I should have mentioned it, but I'm using Ubuntu 12.04 and the SD card is mounted automatically as soon as I put it into the slot. My current hypothesis why the symlink in dosdevices is missing is that the partition is added using 'add_volume' instead of 'add_dos_device'. As you may have read, my patch to fix the GetLogicalDrives issue is wrong so I'll need more time to investigate. The best thing you can do is fill a bug with all those details and tell me its bug number. But you'll have to wait a bit .. my spare time is limited.
Re: Build failure of [PATCH 5/5] kernel32/tests: Add a IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) test (try 4) ?
On 07/16/2012 06:12 PM, Alexandre Julliard wrote: There's nothing mystic about it, but when you are changing the Mac code, testing the build on a Mac is recommended ;-) gcc -m32 -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_NTSYSTEM_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -I/sw/include/freetype2 -I/sw/include -I/sw/include -g -O2 -o cdrom.o cdrom.c cdrom.c: In function 'DVD_ReadStructure': cdrom.c:2718: error: invalid type argument of '-' cdrom.c:2719: error: invalid type argument of '-' cdrom.c:2720: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' cdrom.c:2721: error: invalid type argument of '-' make[1]: *** [cdrom.o] Error 1 Sorry about that : I don't have access to a Mac, even virtualized. A good developer can write code without compiling it but obviously, I'm not good enough. Anyway, I just sent a fifth try.
re: msvcp90: handle npos as a len in basic_string::replace
Daniel Lehman wrote: @@ -1949,7 +1949,7 @@ basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_ch -if(off+len this-size) +if(off+len off || off+len this-size) len = this-size-off; Wouldn't this be more elegant: if(num this-size-pos) num = this-size-pos; ? Also, you may have missed the similar case in basic_string_char_compare_substr_cstr_len (which uses 'pos' and 'num' rather than 'off' and 'len'). See http://bugs.winehq.org/show_bug.cgi?id=31085#c5
RE: msvcp90: handle npos as a len in basic_string::replace
-Original Message- From: daniel.r.ke...@gmail.com [mailto:daniel.r.ke...@gmail.com] On Behalf Of Dan Kegel Sent: Monday, July 16, 2012 12:27 PM To: Daniel Lehman Cc: wine-devel@winehq.org Subject: re: msvcp90: handle npos as a len in basic_string::replace Daniel Lehman wrote: @@ -1949,7 +1949,7 @@ basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_ch -if(off+len this-size) +if(off+len off || off+len this-size) len = this-size-off; Wouldn't this be more elegant: if(num this-size-pos) num = this-size-pos; ? Yeah, that looks better. I'll change it Also, you may have missed the similar case in basic_string_char_compare_substr_cstr_len (which uses 'pos' and 'num' rather than 'off' and 'len'). See http://bugs.winehq.org/show_bug.cgi?id=31085#c5 I hadn't run into that issue