winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
617 discussions
Start a n
N
ew thread
James Hawkins : cabinet: Add initial tests for Extract.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: ca0246fbde6e94e1c53128d63bee2a1d92d056b2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ca0246fbde6e94e1c53128d…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Jan 10 12:14:47 2006 +0100 cabinet: Add initial tests for Extract. --- configure | 3 configure.ac | 1 dlls/cabinet/Makefile.in | 2 dlls/cabinet/tests/.gitignore | 3 dlls/cabinet/tests/Makefile.in | 13 + dlls/cabinet/tests/extract.c | 388 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 409 insertions(+), 1 deletions(-) create mode 100644 dlls/cabinet/tests/.gitignore create mode 100644 dlls/cabinet/tests/Makefile.in create mode 100644 dlls/cabinet/tests/extract.c
1
0
0
0
James Hawkins : cabinet: Implement Extract on top of FDI.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: 54565b72fd07e6b295601ee17eb483ecf25772b4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=54565b72fd07e6b295601ee…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Jan 10 12:13:07 2006 +0100 cabinet: Implement Extract on top of FDI. --- dlls/cabinet/cabinet_main.c | 266 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 224 insertions(+), 42 deletions(-) diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c index 0be8ed4..08eeb5c 100644 --- a/dlls/cabinet/cabinet_main.c +++ b/dlls/cabinet/cabinet_main.c @@ -37,6 +37,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(cabinet); +/* the following defintions are copied from msvcrt/fcntl.h */ + +#define _O_RDONLY 0 +#define _O_WRONLY 1 +#define _O_RDWR 2 +#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) + + /*********************************************************************** * DllGetVersion (CABINET.2) * @@ -66,6 +74,195 @@ HRESULT WINAPI DllGetVersion (DLLVERSION return S_OK; } +/* FDI callback functions */ + +static void *mem_alloc(ULONG cb) +{ + return HeapAlloc(GetProcessHeap(), 0, cb); +} + +static void mem_free(void *memory) +{ + HeapFree(GetProcessHeap(), 0, memory); +} + +static INT_PTR fdi_open(char *pszFile, int oflag, int pmode) +{ + HANDLE handle; + DWORD dwAccess = 0; + DWORD dwShareMode = 0; + DWORD dwCreateDisposition = OPEN_EXISTING; + + switch (oflag & _O_ACCMODE) + { + case _O_RDONLY: + dwAccess = GENERIC_READ; + dwShareMode = FILE_SHARE_READ | FILE_SHARE_DELETE; + break; + case _O_WRONLY: + dwAccess = GENERIC_WRITE; + dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + case _O_RDWR: + dwAccess = GENERIC_READ | GENERIC_WRITE; + dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + } + + if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES) + dwCreateDisposition = OPEN_EXISTING; + else + dwCreateDisposition = CREATE_NEW; + + handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL, + dwCreateDisposition, 0, NULL); + + return (INT_PTR) handle; +} + +static UINT fdi_read(INT_PTR hf, void *pv, UINT cb) +{ + HANDLE handle = (HANDLE) hf; + DWORD dwRead; + + if (ReadFile(handle, pv, cb, &dwRead, NULL)) + return dwRead; + + return 0; +} + +static UINT fdi_write(INT_PTR hf, void *pv, UINT cb) +{ + HANDLE handle = (HANDLE) hf; + DWORD dwWritten; + + if (WriteFile(handle, pv, cb, &dwWritten, NULL)) + return dwWritten; + + return 0; +} + +static int fdi_close(INT_PTR hf) +{ + HANDLE handle = (HANDLE) hf; + return CloseHandle(handle) ? 0 : -1; +} + +static long fdi_seek(INT_PTR hf, long dist, int seektype) +{ + HANDLE handle = (HANDLE) hf; + return SetFilePointer(handle, dist, NULL, seektype); +} + +static void fill_file_node(struct ExtractFileList *pNode, LPSTR szFilename) +{ + pNode->next = NULL; + pNode->unknown = TRUE; + + pNode->filename = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1); + lstrcpyA(pNode->filename, szFilename); +} + +static BOOL file_in_list(struct ExtractFileList *pNode, LPSTR szFilename) +{ + while (pNode) + { + if (!lstrcmpiA(pNode->filename, szFilename)) + return TRUE; + + pNode = pNode->next; + } + + return FALSE; +} + +static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) +{ + switch (fdint) + { + case fdintCOPY_FILE: + { + struct ExtractFileList **fileList; + EXTRACTdest *pDestination = pfdin->pv; + LPSTR szFullPath, szDirectory; + HANDLE hFile = 0; + DWORD dwSize; + + dwSize = lstrlenA(pDestination->directory) + + lstrlenA("\\") + lstrlenA(pfdin->psz1) + 1; + szFullPath = HeapAlloc(GetProcessHeap(), 0, dwSize); + + lstrcpyA(szFullPath, pDestination->directory); + lstrcatA(szFullPath, "\\"); + lstrcatA(szFullPath, pfdin->psz1); + + /* pull out the destination directory string from the full path */ + dwSize = strrchr(szFullPath, '\\') - szFullPath + 1; + szDirectory = HeapAlloc(GetProcessHeap(), 0, dwSize); + lstrcpynA(szDirectory, szFullPath, dwSize); + + if (pDestination->flags & EXTRACT_FILLFILELIST) + { + fileList = &pDestination->filelist; + + while (*fileList) + fileList = &((*fileList)->next); + + *fileList = HeapAlloc(GetProcessHeap(), 0, + sizeof(struct ExtractFileList)); + + fill_file_node(*fileList, pfdin->psz1); + lstrcpyA(pDestination->lastfile, szFullPath); + pDestination->filecount++; + } + + if (pDestination->flags & EXTRACT_EXTRACTFILES) + { + /* skip this file it it's not in the file list */ + if (!file_in_list(pDestination->filelist, pfdin->psz1)) + return 0; + + /* create the destination directory if it doesn't exist */ + if (GetFileAttributesA(szDirectory) == INVALID_FILE_ATTRIBUTES) + CreateDirectoryA(szDirectory, NULL); + + hFile = CreateFileA(szFullPath, GENERIC_READ | GENERIC_WRITE, 0, NULL, + CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + hFile = 0; + } + + HeapFree(GetProcessHeap(), 0, szFullPath); + HeapFree(GetProcessHeap(), 0, szDirectory); + + return (INT_PTR) hFile; + } + + case fdintCLOSE_FILE_INFO: + { + FILETIME ft; + FILETIME ftLocal; + HANDLE handle = (HANDLE) pfdin->hf; + + if (!DosDateTimeToFileTime(pfdin->date, pfdin->time, &ft)) + return FALSE; + + if (!LocalFileTimeToFileTime(&ft, &ftLocal)) + return FALSE; + + if (!SetFileTime(handle, &ftLocal, 0, &ftLocal)) + return FALSE; + + CloseHandle(handle); + return TRUE; + } + + default: + return 0; + } +} + /*********************************************************************** * Extract (CABINET.3) * @@ -103,48 +300,33 @@ HRESULT WINAPI DllGetVersion (DLLVERSION */ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName) { -#define DUMPC(idx) idx >= sizeof(EXTRACTdest) ? ' ' : \ - ((unsigned char*) dest)[idx] >= 0x20 ? \ - ((unsigned char*) dest)[idx] : '.' - -#define DUMPH(idx) idx >= sizeof(EXTRACTdest) ? 0x55 : ((unsigned char*) dest)[idx] - - LPSTR dir; - unsigned int i; - - TRACE("(dest == %0lx, szCabName == %s)\n", (long) dest, debugstr_a(szCabName)); - - if (!dest) { - /* win2k will crash here */ - FIXME("called without valid parameter dest!\n"); - return E_OUTOFMEMORY; - } - for (i=0; i < sizeof(EXTRACTdest); i+=8) - TRACE( "dest[%04x]:%02x %02x %02x %02x %02x %02x %02x %02x %c%c%c%c%c%c%c%c\n", - i, - DUMPH(i+0), DUMPH(i+1), DUMPH(i+2), DUMPH(i+3), - DUMPH(i+4), DUMPH(i+5), DUMPH(i+6), DUMPH(i+7), - DUMPC(i+0), DUMPC(i+1), DUMPC(i+2), DUMPC(i+3), - DUMPC(i+4), DUMPC(i+5), DUMPC(i+6), DUMPC(i+7)); - - dir = LocalAlloc(LPTR, strlen(dest->directory)+1); - if (!dir) return E_OUTOFMEMORY; - lstrcpyA(dir, dest->directory); - dest->filecount=0; - dest->filelist = NULL; - - TRACE("extracting to dir: %s\n", debugstr_a(dir)); - - /* FIXME: what to do on failure? */ - if (!process_cabinet(szCabName, dir, FALSE, FALSE, dest)) { - LocalFree(dir); - return E_OUTOFMEMORY; - } + HRESULT res = S_OK; + HFDI hfdi; + ERF erf; + + TRACE("(%p, %s)\n", dest, szCabName); + + hfdi = FDICreate(mem_alloc, + mem_free, + fdi_open, + fdi_read, + fdi_write, + fdi_close, + fdi_seek, + cpuUNKNOWN, + &erf); + + if (!hfdi) + return E_FAIL; + + if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES) + return S_OK; + + if (!FDICopy(hfdi, (LPSTR)szCabName, "", 0, + fdi_notify_extract, NULL, dest)) + res = E_FAIL; - LocalFree(dir); + FDIDestroy(hfdi); - TRACE("filecount %08lx,lastfile %s\n", - dest->filecount, debugstr_a(dest->lastfile)); - - return S_OK; + return res; }
1
0
0
0
Rein Klazes : winedos: Open files with write access on read only media.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: 43694d95824d51ea6f4475958e4553450ff2705c URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=43694d95824d51ea6f44759…
Author: Rein Klazes <wijn(a)wanadoo.nl> Date: Tue Jan 10 12:12:46 2006 +0100 winedos: Open files with write access on read only media. If the CreateFile in INT21_CreateFile fails with ERROR_WRITE_PROTECT, retry without write access. --- dlls/winedos/int21.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index a75f7a6..85edf2a 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -1090,6 +1090,12 @@ static BOOL INT21_CreateFile( CONTEXT86 { winHandle = CreateFileW( pathW, winAccess, winSharing, NULL, winMode, winAttributes, 0 ); + /* DOS allows to open files on a CDROM R/W */ + if( winHandle == INVALID_HANDLE_VALUE && + GetLastError()== ERROR_WRITE_PROTECT) { + winHandle = CreateFileW( pathW, winAccess & ~GENERIC_WRITE, + winSharing, NULL, winMode, winAttributes, 0 ); + } if (winHandle == INVALID_HANDLE_VALUE) return FALSE;
1
0
0
0
Phil Krylov : riched20: Speed up text insertion.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: d82af6f7115b326a75451cbf2de171846d838739 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d82af6f7115b326a75451cb…
Author: Phil Krylov <phil(a)newstar.rinet.ru> Date: Tue Jan 10 12:10:49 2006 +0100 riched20: Speed up text insertion. Optimized reading large texts into RichEdit to be an O(n) order algorythm instead of O(n^2) by removing extraneous conversions of character offsets to run offsets. --- dlls/riched20/caret.c | 12 +---------- dlls/riched20/editor.h | 2 ++ dlls/riched20/para.c | 53 +++++++++++++++++++++++++++--------------------- dlls/riched20/run.c | 46 ++++++++++++++++++++++++++++-------------- 4 files changed, 64 insertions(+), 49 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 69c6ca1..03bfcf3 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -331,19 +331,13 @@ ME_InternalInsertTextFromCursor(ME_TextE const WCHAR *str, int len, ME_Style *style, int flags) { - ME_DisplayItem *pNewRun = NULL; ME_Cursor *p = &editor->pCursors[nCursor]; editor->bCaretAtEnd = FALSE; assert(p->pRun->type == diRun); - ME_AddRefStyle(style); - - pNewRun = ME_MakeRun(style, ME_MakeStringN(str, len), flags); /* addrefs style */ - ME_InsertRun(editor, ME_CharOfsFromRunOfs(editor, p->pRun, p->nOffset), pNewRun); - ME_DestroyDisplayItem(pNewRun); - ME_ReleaseStyle(style); + ME_InsertRunAtCursor(editor, p, style, str, len, flags); } @@ -385,14 +379,10 @@ void ME_InsertTextFromCursor(ME_TextEdit } if (pos-str < len) { /* handle EOLs */ ME_DisplayItem *tp, *end_run; - ME_Paragraph *para; ME_Style *tmp_style; if (pos!=str) ME_InternalInsertTextFromCursor(editor, nCursor, str, pos-str, style, 0); p = &editor->pCursors[nCursor]; - tp = ME_FindItemBack(p->pRun, diParagraph); - para = &tp->member.para; - assert(tp); if (p->nOffset) { ME_SplitRunSimple(editor, p->pRun, p->nOffset); p = &editor->pCursors[nCursor]; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 420435f..98167c7 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -107,6 +107,8 @@ int ME_RowNumberFromCharOfs(ME_TextEdito ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags); /* note: ME_InsertRun inserts a copy of the specified run - so you need to destroy the original */ ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem *pItem); +ME_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, + ME_Style *style, const WCHAR *str, int len, int flags); void ME_CheckCharOffsets(ME_TextEditor *editor); void ME_PropagateCharOffset(ME_DisplayItem *p, int shift); void ME_GetGraphicsSize(ME_TextEditor *editor, ME_Run *run, SIZE *pSize); diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index a6a548f..b2295c7 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -303,21 +303,37 @@ void ME_SetParaFormat(ME_TextEditor *edi para->member.para.nFlags |= MEPF_REWRAP; } + +void +ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end) +{ + ME_Cursor *pEndCursor = &editor->pCursors[1]; + + *para = ME_GetParagraph(editor->pCursors[0].pRun); + *para_end = ME_GetParagraph(editor->pCursors[1].pRun); + if ((*para_end)->member.para.nCharOfs < (*para)->member.para.nCharOfs) { + ME_DisplayItem *tmp = *para; + + *para = *para_end; + *para_end = tmp; + pEndCursor = &editor->pCursors[0]; + } + + /* selection consists of chars from nFrom up to nTo-1 */ + if ((*para_end)->member.para.nCharOfs > (*para)->member.para.nCharOfs) { + if (!pEndCursor->nOffset) { + *para_end = ME_GetParagraph(ME_FindItemBack(pEndCursor->pRun, diRun)); + } + } +} + + void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { - int nFrom, nTo; - ME_DisplayItem *para, *para_end, *run; - int nOffset; - - ME_GetSelection(editor, &nFrom, &nTo); - if (nTo>nFrom) /* selection consists of chars from nFrom up to nTo-1 */ - nTo--; - - ME_RunOfsFromCharOfs(editor, nFrom, &run, &nOffset); - para = ME_GetParagraph(run); - ME_RunOfsFromCharOfs(editor, nTo, &run, &nOffset); - para_end = ME_GetParagraph(run); + ME_DisplayItem *para, *para_end; + ME_GetSelectionParas(editor, ¶, ¶_end); + do { ME_SetParaFormat(editor, para, pFmt); if (para == para_end) @@ -338,19 +354,10 @@ void ME_GetParaFormat(ME_TextEditor *edi void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { - int nFrom, nTo; - ME_DisplayItem *para, *para_end, *run; - int nOffset; + ME_DisplayItem *para, *para_end; PARAFORMAT2 tmp; - ME_GetSelection(editor, &nFrom, &nTo); - if (nTo>nFrom) /* selection consists of chars from nFrom up to nTo-1 */ - nTo--; - - ME_RunOfsFromCharOfs(editor, nFrom, &run, &nOffset); - para = ME_GetParagraph(run); - ME_RunOfsFromCharOfs(editor, nTo, &run, &nOffset); - para_end = ME_GetParagraph(run); + ME_GetSelectionParas(editor, ¶, ¶_end); ME_GetParaFormat(editor, para, pFmt); if (para == para_end) return; diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 568472c..5c97941 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -293,31 +293,47 @@ ME_DisplayItem *ME_MakeRun(ME_Style *s, return item; } + ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem *pItem) { ME_Cursor tmp; ME_DisplayItem *pDI; - ME_UndoItem *pUI; assert(pItem->type == diRun || pItem->type == diUndoInsertRun); + ME_CursorFromCharOfs(editor, nCharOfs, &tmp); + pDI = ME_InsertRunAtCursor(editor, &tmp, pItem->member.run.style, + pItem->member.run.strText->szData, + pItem->member.run.strText->nLen, + pItem->member.run.nFlags); + + return pDI; +} + +ME_DisplayItem * +ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, + const WCHAR *str, int len, int flags) +{ + ME_DisplayItem *pDI; + ME_UndoItem *pUI; + + if (cursor->nOffset) { + cursor->pRun = ME_SplitRunSimple(editor, cursor->pRun, cursor->nOffset); + cursor->nOffset = 0; + } + pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL); if (pUI) { - pUI->nStart = nCharOfs; - pUI->nLen = pItem->member.run.strText->nLen; + pUI->nStart = cursor->pRun->member.run.nCharOfs; + pUI->nLen = len; } - ME_CursorFromCharOfs(editor, nCharOfs, &tmp); - if (tmp.nOffset) { - tmp.pRun = ME_SplitRunSimple(editor, tmp.pRun, tmp.nOffset); - tmp.nOffset = 0; - } - pDI = ME_MakeRun(pItem->member.run.style, ME_StrDup(pItem->member.run.strText), pItem->member.run.nFlags); - pDI->member.run.nCharOfs = tmp.pRun->member.run.nCharOfs; - ME_InsertBefore(tmp.pRun, pDI); - TRACE("Shift length:%d\n", pDI->member.run.strText->nLen); - ME_PropagateCharOffset(tmp.pRun, pDI->member.run.strText->nLen); - ME_GetParagraph(tmp.pRun)->member.para.nFlags |= MEPF_REWRAP; - + + pDI = ME_MakeRun(style, ME_MakeStringN(str, len), flags); + pDI->member.run.nCharOfs = cursor->pRun->member.run.nCharOfs; + ME_InsertBefore(cursor->pRun, pDI); + TRACE("Shift length:%d\n", len); + ME_PropagateCharOffset(cursor->pRun, len); + ME_GetParagraph(cursor->pRun)->member.para.nFlags |= MEPF_REWRAP; return pDI; }
1
0
0
0
Mike McCormack : advapi32: If we can't connect to a service's pipe, name the service in
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: a8b71c2727c67ccd6df2d78f85561684eb6d31d2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a8b71c2727c67ccd6df2d78…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Jan 10 12:10:34 2006 +0100 advapi32: If we can't connect to a service's pipe, name the service in the error message. --- dlls/advapi32/service.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 60d0f8d..1db25d7 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -653,7 +653,8 @@ static DWORD WINAPI service_control_disp if (pipe==INVALID_HANDLE_VALUE) { - ERR("failed to create pipe, error = %ld\n", GetLastError()); + ERR("failed to create pipe for %s, error = %ld\n", + debugstr_w(service->name), GetLastError()); return 0; }
1
0
0
0
Mike McCormack : msi: Count the number of columns requested and allocate that many,
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: f69d7bf0f33b3ef75d81df718c4010dc8a1943c9 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f69d7bf0f33b3ef75d81df7…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Jan 10 12:10:19 2006 +0100 msi: Count the number of columns requested and allocate that many, as columns may be select more than once in from a table. --- dlls/msi/select.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/msi/select.c b/dlls/msi/select.c index 9bc2b96..7c79260 100644 --- a/dlls/msi/select.c +++ b/dlls/msi/select.c @@ -245,20 +245,23 @@ static UINT SELECT_AddColumn( MSISELECTV return ERROR_SUCCESS; } +int select_count_columns( column_info *col ) +{ + int n; + for (n = 0; col; col = col->next) + n++; + return n; +} + UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, column_info *columns ) { MSISELECTVIEW *sv = NULL; - UINT count = 0, r; + UINT count = 0, r = ERROR_SUCCESS; TRACE("%p\n", sv ); - r = table->ops->get_dimensions( table, NULL, &count ); - if( r != ERROR_SUCCESS ) - { - ERR("can't get table dimensions\n"); - return r; - } + count = select_count_columns( columns ); sv = msi_alloc_zero( sizeof *sv + count*sizeof (UINT) ); if( !sv )
1
0
0
0
Mike McCormack : msi: Don't crash if there's no script present when we try execute one.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: aa81e4fa6860f39c6f735596785ed07783ae6920 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=aa81e4fa6860f39c6f73559…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Jan 10 12:09:19 2006 +0100 msi: Don't crash if there's no script present when we try execute one. --- dlls/msi/action.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 9ccb716..6f4ce41 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1417,6 +1417,12 @@ static UINT execute_script(MSIPACKAGE *p TRACE("Executing Script %i\n",script); + if (!package->script) + { + ERR("no script!\n"); + return ERROR_FUNCTION_FAILED; + } + for (i = 0; i < package->script->ActionCount[script]; i++) { LPWSTR action;
1
0
0
0
Mike McCormack : msi: Fixed the prototype of MsiDatabaseIsTablePersistent.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: 1acf032a99dc9734f4558c5f6a7c8976a45af30b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=1acf032a99dc9734f4558c5…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Jan 10 12:09:11 2006 +0100 msi: Fixed the prototype of MsiDatabaseIsTablePersistent. Implemented MsiDatabaseIsTablePersistentA via the W function. --- dlls/msi/msiquery.c | 23 ++++++++++++++++++----- include/msiquery.h | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index 4824d87..b841086 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -853,16 +853,29 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysA(M return r; } -UINT WINAPI MsiDatabaseIsTablePersistentA( +MSICONDITION WINAPI MsiDatabaseIsTablePersistentA( MSIHANDLE hDatabase, LPSTR szTableName) { - FIXME("%lx %s\n", hDatabase, debugstr_a(szTableName)); - return ERROR_CALL_NOT_IMPLEMENTED; + LPWSTR szwTableName = NULL; + MSICONDITION r; + + TRACE("%lx %s\n", hDatabase, debugstr_a(szTableName)); + + if( szTableName ) + { + szwTableName = strdupAtoW( szTableName ); + if( !szwTableName ) + return MSICONDITION_ERROR; + } + r = MsiDatabaseIsTablePersistentW( hDatabase, szwTableName ); + msi_free( szwTableName ); + + return r; } -UINT WINAPI MsiDatabaseIsTablePersistentW( +MSICONDITION WINAPI MsiDatabaseIsTablePersistentW( MSIHANDLE hDatabase, LPWSTR szTableName) { FIXME("%lx %s\n", hDatabase, debugstr_w(szTableName)); - return ERROR_CALL_NOT_IMPLEMENTED; + return MSICONDITION_FALSE; } diff --git a/include/msiquery.h b/include/msiquery.h index c98c30f..09e5c16 100644 --- a/include/msiquery.h +++ b/include/msiquery.h @@ -256,8 +256,8 @@ UINT WINAPI MsiOpenDatabaseW(LPCWSTR, LP UINT WINAPI MsiOpenDatabaseA(LPCSTR, LPCSTR, MSIHANDLE*); #define MsiOpenDatabase WINELIB_NAME_AW(MsiOpenDatabase) -UINT WINAPI MsiDatabaseIsTablePersistentA(MSIHANDLE, LPSTR); -UINT WINAPI MsiDatabaseIsTablePersistentW(MSIHANDLE, LPWSTR); +MSICONDITION WINAPI MsiDatabaseIsTablePersistentA(MSIHANDLE, LPSTR); +MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(MSIHANDLE, LPWSTR); #define MsiDatabaseIsTablePersistent WINELIB_NAME_AW(MsiDatabaseIsTablePersistent) UINT WINAPI MsiSequenceA(MSIHANDLE, LPCSTR, INT);
1
0
0
0
Troy Rollo : user: Fix return type of EnableMenuItem.
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: b7652d89db4c91a4d736118860ac9dd18a186b48 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b7652d89db4c91a4d736118…
Author: Troy Rollo <wine(a)troy.rollo.name> Date: Tue Jan 10 12:08:48 2006 +0100 user: Fix return type of EnableMenuItem. --- dlls/user/menu.c | 2 +- dlls/user/user16.c | 2 +- include/wine/winuser16.h | 2 +- include/winuser.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/user/menu.c b/dlls/user/menu.c index e04291d..ba3607e 100644 --- a/dlls/user/menu.c +++ b/dlls/user/menu.c @@ -3235,7 +3235,7 @@ DWORD WINAPI CheckMenuItem( HMENU hMenu, /********************************************************************** * EnableMenuItem (USER32.@) */ -UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) +BOOL WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) { UINT oldflags; MENUITEM *item; diff --git a/dlls/user/user16.c b/dlls/user/user16.c index 76008a3..b945ce0 100644 --- a/dlls/user/user16.c +++ b/dlls/user/user16.c @@ -531,7 +531,7 @@ BOOL16 WINAPI CheckMenuItem16( HMENU16 h /********************************************************************** * EnableMenuItem (USER.155) */ -UINT16 WINAPI EnableMenuItem16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags ) +BOOL16 WINAPI EnableMenuItem16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags ) { return EnableMenuItem( HMENU_32(hMenu), wItemID, wFlags ); } diff --git a/include/wine/winuser16.h b/include/wine/winuser16.h index 5734f02..e11f7fd 100644 --- a/include/wine/winuser16.h +++ b/include/wine/winuser16.h @@ -716,7 +716,7 @@ BOOL16 WINAPI DrawIconEx16(HDC16,IN VOID WINAPI DrawMenuBar16(HWND16); INT16 WINAPI DrawText16(HDC16,LPCSTR,INT16,LPRECT16,UINT16); BOOL16 WINAPI EmptyClipboard16(void); -UINT16 WINAPI EnableMenuItem16(HMENU16,UINT16,UINT16); +BOOL16 WINAPI EnableMenuItem16(HMENU16,UINT16,UINT16); BOOL16 WINAPI EnableScrollBar16(HWND16,INT16,UINT16); BOOL16 WINAPI EnableWindow16(HWND16,BOOL16); BOOL16 WINAPI EndDeferWindowPos16(HDWP16); diff --git a/include/winuser.h b/include/winuser.h index e89b26b..aaed2de 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -4260,7 +4260,7 @@ INT WINAPI DrawTextExA(HDC,LPSTR INT WINAPI DrawTextExW(HDC,LPWSTR,INT,LPRECT,UINT,LPDRAWTEXTPARAMS); #define DrawTextEx WINELIB_NAME_AW(DrawTextEx) BOOL WINAPI EmptyClipboard(void); -UINT WINAPI EnableMenuItem(HMENU,UINT,UINT); +BOOL WINAPI EnableMenuItem(HMENU,UINT,UINT); BOOL WINAPI EnableScrollBar(HWND,INT,UINT); BOOL WINAPI EnableWindow(HWND,BOOL); BOOL WINAPI EndDeferWindowPos(HDWP);
1
0
0
0
Troy Rollo : shell32: Fix bug in renaming files in the file dialogs when UNIX paths
by Alexandre Julliard
10 Jan '06
10 Jan '06
Module: wine Branch: refs/heads/master Commit: e80a85a33bca104e04a3343bda46e5f19dbb153a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e80a85a33bca104e04a3343…
Author: Troy Rollo <wine(a)troy.rollo.name> Date: Tue Jan 10 12:08:28 2006 +0100 shell32: Fix bug in renaming files in the file dialogs when UNIX paths are being used. --- dlls/shell32/shfldr_unixfs.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 394a8c6..e5aee56 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -1266,7 +1266,17 @@ static HRESULT WINAPI UnixFolder_IShellF return E_FAIL; /* Build a pidl for the path of the renamed file */ - pwszDosDest = wine_get_dos_file_name(szDest); + if (This->m_dwPathMode == PATHMODE_DOS) + { + pwszDosDest = wine_get_dos_file_name(szDest); + } + else + { + int len = MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, NULL, 0); + + pwszDosDest = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, pwszDosDest, len); + } if (!pwszDosDest || !UNIXFS_path_to_pidl(This, pwszDosDest, &pidlDest)) { HeapFree(GetProcessHeap(), 0, pwszDosDest); rename(szDest, szSrc); /* Undo the renaming */
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200