OpenFile has a filpath limit of 128. Use _lopen which calls through to CreateFile which doesn't have this limit.
Alt patch without any copied code.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48832 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27324
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/winmm/mmio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index 6f14301975..4f9c5ad77a 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -76,8 +76,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
/* if filename NULL, assume open file handle in adwInfo[0] */ if (szFileName) { - OFSTRUCT ofs; - lpmmioinfo->adwInfo[0] = OpenFile(szFileName, &ofs, lpmmioinfo->dwFlags & 0xFFFF); + if (lpmmioinfo->dwFlags & OF_CREATE) + lpmmioinfo->adwInfo[0] = _lcreat(szFileName, 0); + else + lpmmioinfo->adwInfo[0] = _lopen(szFileName, lpmmioinfo->dwFlags); } if (lpmmioinfo->adwInfo[0] == HFILE_ERROR) ret = MMIOERR_FILENOTFOUND;
On Wed, Apr 01, 2020 at 06:41:27PM +1100, Alistair Leslie-Hughes wrote:
OpenFile has a filpath limit of 128. Use _lopen which calls through to CreateFile which doesn't have this limit.
Alt patch without any copied code.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48832 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27324
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
dlls/winmm/mmio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index 6f14301975..4f9c5ad77a 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -76,8 +76,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
/* if filename NULL, assume open file handle in adwInfo[0] */ if (szFileName) {
OFSTRUCT ofs;
lpmmioinfo->adwInfo[0] = OpenFile(szFileName, &ofs, lpmmioinfo->dwFlags & 0xFFFF);
if (lpmmioinfo->dwFlags & OF_CREATE)
lpmmioinfo->adwInfo[0] = _lcreat(szFileName, 0);
The trouble with this approach is it's ignoring the SHARE bits, which OpenFile would pass through to CreateFile. Is that intended?
Andrew
Hi Andrew,
On 4/4/20 3:04 am, Andrew Eikum wrote:
On Wed, Apr 01, 2020 at 06:41:27PM +1100, Alistair Leslie-Hughes wrote:
lpmmioinfo->adwInfo[0] = _lcreat(szFileName, 0);
The trouble with this approach is it's ignoring the SHARE bits, which OpenFile would pass through to CreateFile. Is that intended?
No, that wasn't my intention, it's was more another approach we could take. Here is the patch which uses the code from kernel32. https://source.winehq.org/patches/data/182464
Alistair.