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
March 2007
----- 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
3 participants
844 discussions
Start a n
N
ew thread
Francois Gouget : comctl32/tests: Add missing '\n's in ok() calls.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: b8f517b063e93e58ae3856f870bbaed436cfa61b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8f517b063e93e58ae3856f87…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Mar 14 09:17:31 2007 +0100 comctl32/tests: Add missing '\n's in ok() calls. --- dlls/comctl32/tests/listview.c | 8 ++++---- dlls/comctl32/tests/tab.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 13ef0f3..3a7186b 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -794,7 +794,7 @@ static void test_icon_spacing(void) DWORD r; hwnd = create_custom_listview_control(LVS_ICON); - ok(hwnd != NULL, "failed to create a listview window"); + ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -826,7 +826,7 @@ static void test_color(void) COLORREF colors[4] = {RGB(0,0,0), RGB(100,50,200), CLR_NONE, RGB(255,255,255)}; hwnd = create_listview_control(); - ok(hwnd != NULL, "failed to create a listview window"); + ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -872,7 +872,7 @@ static void test_item_count(void) static CHAR item2text[] = "item2"; hwnd = create_listview_control(); - ok(hwnd != NULL, "failed to create a listview window"); + ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -962,7 +962,7 @@ static void test_item_position(void) static CHAR item2text[] = "item2"; hwnd = create_custom_listview_control(LVS_ICON); - ok(hwnd != NULL, "failed to create a listview window"); + ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index 094faae..9b519d2 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -463,10 +463,10 @@ static void test_getters_setters(INT nTabs) toolTip = create_tooltip(hTab, toolTipText); SendMessage(hTab, TCM_SETTOOLTIPS, (LPARAM) toolTip, 0); - ok (toolTip == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly."); + ok (toolTip == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n"); SendMessage(hTab, TCM_SETTOOLTIPS, (LPARAM) NULL, 0); - ok (NULL == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly."); + ok (NULL == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n"); } DestroyWindow(hTab);
1
0
0
0
Andrew Talbot : avifil32: Constify some variables.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: 76c99d976a06f3d5a599e6ef747e75334e337896 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76c99d976a06f3d5a599e6ef7…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Tue Mar 13 21:42:48 2007 +0000 avifil32: Constify some variables. --- dlls/avifil32/extrachunk.c | 6 ++---- dlls/avifil32/extrachunk.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/avifil32/extrachunk.c b/dlls/avifil32/extrachunk.c index ac3a04d..8fad124 100644 --- a/dlls/avifil32/extrachunk.c +++ b/dlls/avifil32/extrachunk.c @@ -29,8 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(avifile); /* reads a chunk outof the extrachunk-structure */ -HRESULT ReadExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData, - LPLONG size) +HRESULT ReadExtraChunk(const LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData,LPLONG size) { LPBYTE lp; DWORD cb; @@ -68,8 +67,7 @@ HRESULT ReadExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData, } /* writes a chunk into the extrachunk-structure */ -HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData, - LONG size) +HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPCVOID lpData, LONG size) { LPDWORD lp; diff --git a/dlls/avifil32/extrachunk.h b/dlls/avifil32/extrachunk.h index b30e9d8..981f68e 100644 --- a/dlls/avifil32/extrachunk.h +++ b/dlls/avifil32/extrachunk.h @@ -35,10 +35,10 @@ typedef struct _EXTRACHUNKS { } EXTRACHUNKS, *LPEXTRACHUNKS; /* reads a chunk outof the extrachunk-structure */ -HRESULT ReadExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lp,LPLONG size); +HRESULT ReadExtraChunk(const LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lp,LPLONG size); /* writes a chunk into the extrachunk-structure */ -HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lp,LONG size); +HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPCVOID lp,LONG size); /* reads a chunk fomr the HMMIO into the extrachunk-structure */ HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck);
1
0
0
0
Jason Edmeades : cmd.exe: Add DIR /O ordering support.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: 98e37021ab312892381ec318edab0a18deda51d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=98e37021ab312892381ec318e…
Author: Jason Edmeades <us(a)edmeades.me.uk> Date: Tue Mar 13 20:27:46 2007 +0000 cmd.exe: Add DIR /O ordering support. --- programs/cmd/directory.c | 113 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 111 insertions(+), 2 deletions(-) diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index 0c8c5af..1c4d056 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -46,10 +46,20 @@ typedef enum _DISPLAYTIME Written } DISPLAYTIME; +typedef enum _DISPLAYORDER +{ + Name = 0, + Extension, + Size, + Date +} DISPLAYORDER; + static int file_total, dir_total, recurse, wide, bare, max_width, lower; static int shortname, usernames; static ULONGLONG byte_total; static DISPLAYTIME dirTime; +static DISPLAYORDER dirOrder; +static BOOL orderReverse, orderGroupDirs, orderGroupDirsReverse; /***************************************************************************** * WCMD_directory @@ -69,6 +79,10 @@ void WCMD_directory (void) { byte_total = 0; file_total = dir_total = 0; dirTime = Written; + dirOrder = Name; + orderReverse = FALSE; + orderGroupDirs = FALSE; + orderGroupDirsReverse = FALSE; /* Handle args */ paged_mode = (strstr(quals, "/P") != NULL); @@ -96,6 +110,28 @@ void WCMD_directory (void) { } } + if ((p = strstr(quals, "/O")) != NULL) { + p = p + 2; + if (*p==':') p++; /* Skip optional : */ + while (*p && *p != '/') { + switch (*p) { + case 'N': dirOrder = Name; break; + case 'E': dirOrder = Extension; break; + case 'S': dirOrder = Size; break; + case 'D': dirOrder = Date; break; + case '-': if (*(p+1)=='G') orderGroupDirsReverse=TRUE; + else orderReverse = TRUE; + break; + case 'G': orderGroupDirs = TRUE; break; + default: + SetLastError(ERROR_INVALID_PARAMETER); + WCMD_print_error(); + return; + } + p++; + } + } + /* Handle conflicting args and initialization */ if (bare || shortname) wide = FALSE; if (bare) shortname = FALSE; @@ -410,10 +446,83 @@ char * WCMD_strrev (char *buff) { } +/***************************************************************************** + * WCMD_dir_sort + * + * Sort based on the /O options supplied on the command line + */ int WCMD_dir_sort (const void *a, const void *b) { - return (lstrcmpi(((const WIN32_FIND_DATA *)a)->cFileName, - ((const WIN32_FIND_DATA *)b)->cFileName)); + WIN32_FIND_DATA *filea = (WIN32_FIND_DATA *)a; + WIN32_FIND_DATA *fileb = (WIN32_FIND_DATA *)b; + int result = 0; + + /* If /OG or /O-G supplied, dirs go at the top or bottom, ignoring the + requested sort order for the directory components */ + if (orderGroupDirs && + ((filea->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (fileb->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) + { + BOOL aDir = filea->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + if (aDir) result = -1; + else result = 1; + if (orderGroupDirsReverse) result = -result; + return result; + + /* Order by Name: */ + } else if (dirOrder == Name) { + result = lstrcmpi(filea->cFileName, fileb->cFileName); + + /* Order by Size: */ + } else if (dirOrder == Size) { + ULONG64 sizea = (((ULONG64)filea->nFileSizeHigh) << 32) + filea->nFileSizeLow; + ULONG64 sizeb = (((ULONG64)fileb->nFileSizeHigh) << 32) + fileb->nFileSizeLow; + if( sizea < sizeb ) result = -1; + else if( sizea == sizeb ) result = 0; + else result = 1; + + /* Order by Date: (Takes into account which date (/T option) */ + } else if (dirOrder == Date) { + + FILETIME *ft; + ULONG64 timea, timeb; + + if (dirTime == Written) { + ft = &filea->ftLastWriteTime; + timea = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + ft = &fileb->ftLastWriteTime; + timeb = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + } else if (dirTime == Access) { + ft = &filea->ftLastAccessTime; + timea = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + ft = &fileb->ftLastAccessTime; + timeb = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + } else { + ft = &filea->ftCreationTime; + timea = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + ft = &fileb->ftCreationTime; + timeb = (((ULONG64)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; + } + if( timea < timeb ) result = -1; + else if( timea == timeb ) result = 0; + else result = 1; + + /* Order by Extension: (Takes into account which date (/T option) */ + } else if (dirOrder == Extension) { + char drive[10]; + char dir[MAX_PATH]; + char fname[MAX_PATH]; + char extA[MAX_PATH]; + char extB[MAX_PATH]; + + /* Split into components */ + WCMD_splitpath(filea->cFileName, drive, dir, fname, extA); + WCMD_splitpath(fileb->cFileName, drive, dir, fname, extB); + result = lstrcmpi(extA, extB); + } + + if (orderReverse) result = -result; + return result; } /*****************************************************************************
1
0
0
0
Jason Edmeades : cmd.exe: Add dir /X support (sort of...).
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: 1497a2fec420fcef81fb31c6343fa79f43602758 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1497a2fec420fcef81fb31c63…
Author: Jason Edmeades <us(a)edmeades.me.uk> Date: Tue Mar 13 20:27:45 2007 +0000 cmd.exe: Add dir /X support (sort of...). --- programs/cmd/directory.c | 101 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 79 insertions(+), 22 deletions(-) diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index d787a29..0c8c5af 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -33,7 +33,7 @@ int WCMD_dir_sort (const void *a, const void *b); void WCMD_list_directory (char *path, int level); char * WCMD_filesize64 (ULONGLONG free); char * WCMD_strrev (char *buff); - +static void WCMD_getfileowner(char *filename, char *owner, int ownerlen); extern int echo_mode; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; @@ -47,7 +47,7 @@ typedef enum _DISPLAYTIME } DISPLAYTIME; static int file_total, dir_total, recurse, wide, bare, max_width, lower; -static int shortname; +static int shortname, usernames; static ULONGLONG byte_total; static DISPLAYTIME dirTime; @@ -77,6 +77,7 @@ void WCMD_directory (void) { bare = (strstr(quals, "/B") != NULL); lower = (strstr(quals, "/L") != NULL); shortname = (strstr(quals, "/X") != NULL); + usernames = (strstr(quals, "/Q") != NULL); if ((p = strstr(quals, "/T")) != NULL) { p = p + 2; @@ -98,6 +99,7 @@ void WCMD_directory (void) { /* Handle conflicting args and initialization */ if (bare || shortname) wide = FALSE; if (bare) shortname = FALSE; + if (wide) usernames = FALSE; if (wide) { if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &consoleInfo)) @@ -198,12 +200,12 @@ void WCMD_list_directory (char *search_path, int level) { lstrcpyn (real_path, search_path, (p-search_path+2)); /* Load all files into an in memory structure */ - fd = malloc (sizeof(WIN32_FIND_DATA)); + fd = HeapAlloc(GetProcessHeap(),0,sizeof(WIN32_FIND_DATA)); hff = FindFirstFile (search_path, fd); if (hff == INVALID_HANDLE_VALUE) { SetLastError (ERROR_FILE_NOT_FOUND); WCMD_print_error (); - free (fd); + HeapFree(GetProcessHeap(),0,fd); return; } do { @@ -216,7 +218,7 @@ void WCMD_list_directory (char *search_path, int level) { if (tmpLen > widest) widest = tmpLen; } - fd = realloc (fd, (entry_count+1)*sizeof(WIN32_FIND_DATA)); + fd = HeapReAlloc(GetProcessHeap(),0,fd,(entry_count+1)*sizeof(WIN32_FIND_DATA)); if (fd == NULL) { FindClose (hff); WCMD_output ("Memory Allocation Error"); @@ -235,6 +237,7 @@ void WCMD_list_directory (char *search_path, int level) { } for (i=0; i<entry_count; i++) { + char username[24]; /* /L convers all names to lower case */ if (lower) { @@ -242,6 +245,14 @@ void WCMD_list_directory (char *search_path, int level) { while ( (*p = tolower(*p)) ) ++p; } + /* /Q gets file ownership information */ + if (usernames) { + p = strrchr (search_path, '\\'); + lstrcpyn (string, search_path, (p-search_path+2)); + lstrcat (string, (fd+i)->cFileName); + WCMD_getfileowner(string, username, sizeof(username)); + } + if (dirTime == Written) { FileTimeToLocalFileTime (&(fd+i)->ftLastWriteTime, &ft); } else if (dirTime == Access) { @@ -283,13 +294,10 @@ void WCMD_list_directory (char *search_path, int level) { dir_count++; if (!bare) { - if (shortname) { - WCMD_output ("%10s %8s <DIR> %-13s%s\n", - datestring, timestring, (fd+i)->cAlternateFileName, (fd+i)->cFileName); - } else { - WCMD_output ("%10s %8s <DIR> %s\n", - datestring, timestring, (fd+i)->cFileName); - } + WCMD_output ("%10s %8s <DIR> ", datestring, timestring); + if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); + if (usernames) WCMD_output ("%-23s", username); + WCMD_output("%s\n",(fd+i)->cFileName); } else { if (!((strcmp((fd+i)->cFileName, ".") == 0) || (strcmp((fd+i)->cFileName, "..") == 0))) { @@ -303,15 +311,11 @@ void WCMD_list_directory (char *search_path, int level) { file_size.u.HighPart = (fd+i)->nFileSizeHigh; byte_count.QuadPart += file_size.QuadPart; if (!bare) { - if (shortname) { - WCMD_output ("%10s %8s %10s %-13s%s\n", - datestring, timestring, - WCMD_filesize64(file_size.QuadPart), (fd+i)->cAlternateFileName, (fd+i)->cFileName); - } else { - WCMD_output ("%10s %8s %10s %s\n", - datestring, timestring, - WCMD_filesize64(file_size.QuadPart), (fd+i)->cFileName); - } + WCMD_output ("%10s %8s %10s ", datestring, timestring, + WCMD_filesize64(file_size.QuadPart)); + if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); + if (usernames) WCMD_output ("%-23s", username); + WCMD_output("%s\n",(fd+i)->cFileName); } else { WCMD_output ("%s%s\n", recurse?real_path:"", (fd+i)->cFileName); } @@ -352,7 +356,7 @@ void WCMD_list_directory (char *search_path, int level) { WCMD_list_directory (string, 1); } } - free (fd); + HeapFree(GetProcessHeap(),0,fd); return; } @@ -411,3 +415,56 @@ int WCMD_dir_sort (const void *a, const void *b) return (lstrcmpi(((const WIN32_FIND_DATA *)a)->cFileName, ((const WIN32_FIND_DATA *)b)->cFileName)); } + +/***************************************************************************** + * WCMD_getfileowner + * + * Reverse a character string in-place (strrev() is not available under unixen :-( ). + */ +void WCMD_getfileowner(char *filename, char *owner, int ownerlen) { + + ULONG sizeNeeded = 0; + DWORD rc; + char name[MAXSTRING]; + char domain[MAXSTRING]; + + /* In case of error, return empty string */ + *owner = 0x00; + + /* Find out how much space we need for the owner security descritpor */ + GetFileSecurity(filename, OWNER_SECURITY_INFORMATION, 0, 0, &sizeNeeded); + rc = GetLastError(); + + if(rc == ERROR_INSUFFICIENT_BUFFER && sizeNeeded > 0) { + + LPBYTE secBuffer; + PSID pSID = NULL; + BOOL defaulted = FALSE; + ULONG nameLen = MAXSTRING; + ULONG domainLen = MAXSTRING; + SID_NAME_USE nameuse; + + secBuffer = (LPBYTE) HeapAlloc(GetProcessHeap(),0,sizeNeeded * sizeof(BYTE)); + if(!secBuffer) return; + + /* Get the owners security descriptor */ + if(!GetFileSecurity(filename, OWNER_SECURITY_INFORMATION, secBuffer, + sizeNeeded, &sizeNeeded)) { + HeapFree(GetProcessHeap(),0,secBuffer); + return; + } + + /* Get the SID from the SD */ + if(!GetSecurityDescriptorOwner(secBuffer, &pSID, &defaulted)) { + HeapFree(GetProcessHeap(),0,secBuffer); + return; + } + + /* Convert to a username */ + if (LookupAccountSid(NULL, pSID, name, &nameLen, domain, &domainLen, &nameuse)) { + snprintf(owner, ownerlen, "%s%c%s", domain, '\\', name); + } + HeapFree(GetProcessHeap(),0,secBuffer); + } + return; +}
1
0
0
0
Alexandre Julliard : ntdll: Fixed some exception codes and parameters.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: cdb833bf33f319d5063d9d548dce415bd81ce79b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cdb833bf33f319d5063d9d548…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 14 12:02:43 2007 +0100 ntdll: Fixed some exception codes and parameters. --- dlls/ntdll/signal_i386.c | 17 +++++++++-------- dlls/ntdll/tests/exception.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index edfa5ea..df7b517 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -772,7 +772,7 @@ void set_cpu_context( const CONTEXT *context ) * Check if the fault location is a privileged instruction. * Based on the instruction emulation code in dlls/kernel/instr.c. */ -static inline int is_privileged_instr( CONTEXT86 *context ) +static inline DWORD is_privileged_instr( CONTEXT86 *context ) { const BYTE *instr; unsigned int prefix_count = 0; @@ -794,7 +794,7 @@ static inline int is_privileged_instr( CONTEXT86 *context ) case 0xf0: /* lock */ case 0xf2: /* repne */ case 0xf3: /* repe */ - if (++prefix_count >= 15) return 0; + if (++prefix_count >= 15) return EXCEPTION_ILLEGAL_INSTRUCTION; instr++; continue; @@ -805,7 +805,7 @@ static inline int is_privileged_instr( CONTEXT86 *context ) case 0x21: /* mov drX, reg */ case 0x22: /* mov reg, crX */ case 0x23: /* mov reg drX */ - return 1; + return EXCEPTION_PRIV_INSTRUCTION; } return 0; case 0x6c: /* insb (%dx) */ @@ -824,7 +824,7 @@ static inline int is_privileged_instr( CONTEXT86 *context ) case 0xf4: /* hlt */ case 0xfa: /* cli */ case 0xfb: /* sti */ - return 1; + return EXCEPTION_PRIV_INSTRUCTION; default: return 0; } @@ -1144,16 +1144,17 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) case TRAP_x86_SEGNPFLT: /* Segment not present exception */ case TRAP_x86_PROTFLT: /* General protection fault */ case TRAP_x86_UNKNOWN: /* Unknown fault code */ - if (!get_error_code(context) && is_privileged_instr( get_exception_context(rec) )) - rec->ExceptionCode = EXCEPTION_PRIV_INSTRUCTION; - else { WORD err = get_error_code(context); + if (!err && (rec->ExceptionCode = is_privileged_instr( get_exception_context(rec) ))) break; rec->ExceptionCode = EXCEPTION_ACCESS_VIOLATION; rec->NumberParameters = 2; rec->ExceptionInformation[0] = 0; /* if error contains a LDT selector, use that as fault address */ - rec->ExceptionInformation[1] = (err & 7) == 4 ? (err & ~7) : 0xffffffff; + if ((err & 7) == 4 && !wine_ldt_is_system( err | 7 )) + rec->ExceptionInformation[1] = err & ~7; + else + rec->ExceptionInformation[1] = 0xffffffff; } break; case TRAP_x86_PAGEFLT: /* Page fault */ diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index a8aa975..90aa3b6 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -118,7 +118,7 @@ static const struct exception /* test overlong instruction (limit is 16 bytes) */ { { 0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0xfa,0xc3 }, - 0, 16, STATUS_ACCESS_VIOLATION, 2, { 0, 0xffffffff } }, + 0, 16, STATUS_ILLEGAL_INSTRUCTION, 0 }, { { 0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0xfa,0xc3 }, 0, 15, STATUS_PRIVILEGED_INSTRUCTION, 0 },
1
0
0
0
Alexandre Julliard : ntdll/tests: Mask reserved bits before testing dr7.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: 0963b84603dd33166e97abfc38dfc09943f98abc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0963b84603dd33166e97abfc3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 14 12:01:12 2007 +0100 ntdll/tests: Mask reserved bits before testing dr7. Also some spelling fixes. --- dlls/ntdll/tests/exception.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 58306d9..a8aa975 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -321,7 +321,7 @@ static void run_rtlraiseexception_test(DWORD exceptioncode) pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; } -static void test_rtlraiseexcpetion(void) +static void test_rtlraiseexception(void) { if (!pRtlRaiseException) { @@ -553,7 +553,7 @@ static void test_exceptions(void) res = pNtGetContextThread(GetCurrentThread(), &ctx); ok (res == STATUS_SUCCESS,"NtGetContextThread failed with %x\n", res); ok(ctx.Dr0 == 0x42424242,"failed to set debugregister 0 to 0x42424242, got %x\n", ctx.Dr0); - ok(ctx.Dr7 == 0x155,"failed to set debugregister 7 to 0x155, got %x\n", ctx.Dr7); + ok((ctx.Dr7 & ~0xdc00) == 0x155,"failed to set debugregister 7 to 0x155, got %x\n", ctx.Dr7); /* test single stepping behavior */ got_exception = 0; @@ -644,7 +644,7 @@ static void test_debugger(void) status = pNtGetContextThread(pi.hThread, &ctx); ok(!status, "NtGetContextThread failed with 0x%x\n", status); - trace("excpetion 0x%x at %p firstchance=%d Eip=0x%x, Eax=0x%x\n", + trace("exception 0x%x at %p firstchance=%d Eip=0x%x, Eax=0x%x\n", de.u.Exception.ExceptionRecord.ExceptionCode, de.u.Exception.ExceptionRecord.ExceptionAddress, de.u.Exception.dwFirstChance, ctx.Eip, ctx.Eax); @@ -862,7 +862,7 @@ START_TEST(exception) test_prot_fault(); test_exceptions(); - test_rtlraiseexcpetion(); + test_rtlraiseexception(); test_debugger(); test_simd_exceptions();
1
0
0
0
Alexandre Julliard : ntdll: Changed some Solaris defines so that we can access the signal error code.
by Alexandre Julliard
14 Mar '07
14 Mar '07
Module: wine Branch: master Commit: 7d12fbcc5bfd50ee986d94efb4307277c0900913 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d12fbcc5bfd50ee986d94efb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 14 09:53:59 2007 +0100 ntdll: Changed some Solaris defines so that we can access the signal error code. --- dlls/ntdll/signal_i386.c | 35 ++++++++++++++++++----------------- 1 files changed, 18 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 0c32374..edfa5ea 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -59,11 +59,15 @@ #include "thread.h" #include "wine/library.h" #include "ntdll_misc.h" +#include "wine/exception.h" +#include "wine/debug.h" #ifdef HAVE_VALGRIND_MEMCHECK_H #include <valgrind/memcheck.h> #endif +#undef ERR /* Solaris needs to define this */ + /*********************************************************************** * signal context platform-specific definitions */ @@ -196,10 +200,7 @@ typedef struct sigcontext SIGCONTEXT; #ifdef _SCO_DS #include <sys/regset.h> #endif -/* Solaris kludge */ -#undef ERR #include <sys/ucontext.h> -#undef ERR typedef struct ucontext SIGCONTEXT; #ifdef _SCO_DS @@ -232,6 +233,9 @@ typedef struct ucontext SIGCONTEXT; #else #define ESP_sig(context) ((context)->uc_mcontext.gregs[ESP]) #endif +#ifdef ERR +#define ERROR_sig(context) ((context)->uc_mcontext.gregs[ERR]) +#endif #ifdef TRAPNO #define TRAP_sig(context) ((context)->uc_mcontext.gregs[TRAPNO]) #endif @@ -286,9 +290,6 @@ typedef ucontext_t SIGCONTEXT; #endif /* __APPLE__ */ -#include "wine/exception.h" -#include "wine/debug.h" - WINE_DEFAULT_DEBUG_CHANNEL(seh); typedef int (*wine_signal_handler)(unsigned int sig); @@ -899,10 +900,10 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun if ((char *)stack >= (char *)get_signal_stack() && (char *)stack < (char *)get_signal_stack() + signal_stack_size) { - ERR( "nested exception on signal stack in thread %04x eip %08x esp %08x stack %p-%p\n", - GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), - (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, - NtCurrentTeb()->Tib.StackBase ); + WINE_ERR( "nested exception on signal stack in thread %04x eip %08x esp %08x stack %p-%p\n", + GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), + (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, + NtCurrentTeb()->Tib.StackBase ); server_abort_thread(1); } @@ -913,10 +914,10 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)stack; if (diff < 4096) { - ERR( "stack overflow %u bytes in thread %04x eip %08x esp %08x stack %p-%p\n", - diff, GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), - (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, - NtCurrentTeb()->Tib.StackBase ); + WINE_ERR( "stack overflow %u bytes in thread %04x eip %08x esp %08x stack %p-%p\n", + diff, GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), + (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, + NtCurrentTeb()->Tib.StackBase ); server_abort_thread(1); } else WARN( "exception outside of stack limits in thread %04x eip %08x esp %08x stack %p-%p\n", @@ -1165,7 +1166,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) rec->ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; break; default: - ERR( "Got unexpected trap %d\n", get_trap_code(context) ); + WINE_ERR( "Got unexpected trap %d\n", get_trap_code(context) ); /* fall through */ case TRAP_x86_NMI: /* NMI interrupt */ case TRAP_x86_DNA: /* Device not available exception */ @@ -1243,7 +1244,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext ) rec->ExceptionInformation[0] = 0; break; default: - ERR( "Got unexpected trap %d\n", get_trap_code(context) ); + WINE_ERR( "Got unexpected trap %d\n", get_trap_code(context) ); rec->ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION; break; } @@ -1485,7 +1486,7 @@ void __wine_enter_vm86( CONTEXT *context ) break; case VM86_SIGNAL: /* cannot happen because vm86_enter handles this case */ default: - ERR( "unhandled result from vm86 mode %x\n", res ); + WINE_ERR( "unhandled result from vm86 mode %x\n", res ); continue; } __regs_RtlRaiseException( &rec, context );
1
0
0
0
Felix Nawothnig : comctl32: Fix visual glitches with TVS_HASLINES.
by Alexandre Julliard
13 Mar '07
13 Mar '07
Module: wine Branch: master Commit: 6a514819db7430c167c86ba743713da55d007d9f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a514819db7430c167c86ba74…
Author: Felix Nawothnig <flexo(a)holycrap.org> Date: Mon Mar 12 20:43:16 2007 +0100 comctl32: Fix visual glitches with TVS_HASLINES. --- dlls/comctl32/treeview.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 676e56a..8ababc9 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -1730,6 +1730,11 @@ TREEVIEW_NaturalHeight(TREEVIEW_INFO *infoPtr) height = tm.tmHeight + tm.tmExternalLeading + TVHEIGHT_FONT_ADJUST; if (height < infoPtr->normalImageHeight) height = infoPtr->normalImageHeight; + + /* Round down, unless we support odd ("non even") heights. */ + if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT)) + height &= ~1; + return height; } @@ -2325,14 +2330,16 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item) HTREEITEM parent; LOGBRUSH lb; - /* - * Get a dotted grey pen - */ + /* Get a dotted grey pen */ lb.lbStyle = BS_SOLID; lb.lbColor = infoPtr->clrLine; hNewPen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, NULL); hOldPen = SelectObject(hdc, hNewPen); + /* Make sure the center is on a dot (using +2 instead + * of +1 gives us pixel-by-pixel compat with native) */ + centery = (centery + 2) & ~1; + MoveToEx(hdc, item->stateOffset, centery, NULL); LineTo(hdc, centerx - 1, centery);
1
0
0
0
Felix Nawothnig : comctl32: Layout and redraw on TCM_SETIMAGELIST.
by Alexandre Julliard
13 Mar '07
13 Mar '07
Module: wine Branch: master Commit: 0f2f718dea16ec3ad6e37fa48e27a1a177b364bc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f2f718dea16ec3ad6e37fa48…
Author: Felix Nawothnig <flexo(a)holycrap.org> Date: Mon Mar 12 21:23:24 2007 +0100 comctl32: Layout and redraw on TCM_SETIMAGELIST. --- dlls/comctl32/tab.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 711c320..c63b0f7 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -2930,6 +2930,8 @@ static inline LRESULT TAB_SetImageList (TAB_INFO *infoPtr, HIMAGELIST himlNew) HIMAGELIST himlPrev = infoPtr->himl; TRACE("\n"); infoPtr->himl = himlNew; + TAB_SetItemBounds(infoPtr); + InvalidateRect(infoPtr->hwnd, NULL, TRUE); return (LRESULT)himlPrev; }
1
0
0
0
Felix Nawothnig : gdi32: Add PS_ALTERNATE tests.
by Alexandre Julliard
13 Mar '07
13 Mar '07
Module: wine Branch: master Commit: 7fc0becf6ef4b3a8a4fae02afb781bae3f30b38a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7fc0becf6ef4b3a8a4fae02af…
Author: Felix Nawothnig <flexo(a)holycrap.org> Date: Mon Mar 12 20:47:17 2007 +0100 gdi32: Add PS_ALTERNATE tests. --- dlls/gdi32/tests/pen.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/tests/pen.c b/dlls/gdi32/tests/pen.c index 77b1044..77073f1 100644 --- a/dlls/gdi32/tests/pen.c +++ b/dlls/gdi32/tests/pen.c @@ -28,6 +28,8 @@ #include "wine/test.h" +#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) + static void test_logpen(void) { static const struct @@ -427,7 +429,61 @@ else } } +static unsigned int atoi2(const char *s) +{ + unsigned int ret = 0; + while(*s) ret = (ret << 1) | (*s++ == '1'); + return ret; +} + +#define TEST_LINE(x1, x2, z) \ + { int buf = 0; \ + SetBitmapBits(bmp, sizeof(buf), &buf); \ + MoveToEx(hdc, x1, 0, NULL); \ + LineTo(hdc, x2, 0); \ + GetBitmapBits(bmp, sizeof(buf), &buf); \ + expect(atoi2(z), buf); } + +static void test_ps_alternate(void) +{ + HDC hdc; + HBITMAP bmp; + HPEN pen; + LOGBRUSH lb; + + lb.lbStyle = BS_SOLID; + lb.lbColor = RGB(0xff,0xff,0xff); + + SetLastError(0xdeadbeef); + pen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, NULL); + if(pen == NULL && GetLastError() == 0xdeadbeef) { + skip("looks like 9x, skipping PS_ALTERNATE tests\n"); + return; + } + ok(pen != NULL, "gle=%d\n", GetLastError()); + hdc = CreateCompatibleDC(NULL); + ok(hdc != NULL, "gle=%d\n", GetLastError()); + bmp = CreateBitmap(8, 1, 1, 1, NULL); + ok(bmp != NULL, "gle=%d\n", GetLastError()); + ok(SelectObject(hdc, bmp) != NULL, "gle=%d\n", GetLastError()); + ok(SelectObject(hdc, pen) != NULL, "gle=%d\n", GetLastError()); + ok(SetBkMode(hdc, TRANSPARENT), "gle=%d\n", GetLastError()); + + TEST_LINE(0, 1, "10000000") + TEST_LINE(0, 2, "10000000") + TEST_LINE(0, 3, "10100000") + TEST_LINE(0, 4, "10100000") + TEST_LINE(1, 4, "01010000") + TEST_LINE(1, 5, "01010000") + TEST_LINE(4, 8, "00001010") + + DeleteObject(pen); + DeleteObject(bmp); + DeleteDC(hdc); +} + START_TEST(pen) { test_logpen(); + test_ps_alternate(); }
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
85
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Results per page:
10
25
50
100
200