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
July 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
5 participants
857 discussions
Start a n
N
ew thread
Mikołaj Zalewski : shell32: Update the Polish translation.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 28c010cecb55010a531633a7b0d2caf1f0959f79 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=28c010cecb55010a531633a…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Jul 19 18:37:06 2006 +0200 shell32: Update the Polish translation. --- dlls/shell32/shell32_Pl.rc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/shell32_Pl.rc b/dlls/shell32/shell32_Pl.rc index 33830d9..62f4b8e 100644 --- a/dlls/shell32/shell32_Pl.rc +++ b/dlls/shell32/shell32_Pl.rc @@ -165,6 +165,11 @@ STRINGTABLE DISCARDABLE IDS_DELETEFOLDER_CAPTION "Potwierd� usuni�cie katalogu" IDS_DELETEITEM_TEXT "Czy jeste� pewien, �e chcesz usun�� '%1'?" IDS_DELETEMULTIPLE_TEXT "Czy jeste� pewien, �e chcesz usun�� te %1 pliki?" + IDS_DELETESELECTED_TEXT "Czy jeste� pewien, �e chcesz usun�� wybrane elementy?" + IDS_TRASHITEM_TEXT "Czy jeste� pewien, �e chcesz umie�ci� plik '%1' w Koszu?" + IDS_TRASHFOLDER_TEXT "Czy jeste� pewien, �e chcesz umie�ci� folder '%1' i ca�� jego zawarto�� w koszu" + IDS_TRASHMULTIPLE_TEXT "Element�w: %1 - czy na pewno chcesz je umie�ci� w Koszu?" + IDS_CANTTRASH_TEXT "Nie mog� przenie�� elementu '%1' do Kosza. Czy chcesz go zamiast tego usun��?" IDS_OVERWRITEFILE_TEXT "Zast�pi� plik %1?" IDS_OVERWRITEFILE_CAPTION "Potwierd� zast�pienie pliku"
1
0
0
0
Mikołaj Zalewski : shell32: Call the trashing code from SHFileOperationW.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 034c1c4f18552e95dde8d03213c65fe4515f0b7c URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=034c1c4f18552e95dde8d03…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Jul 19 18:37:02 2006 +0200 shell32: Call the trashing code from SHFileOperationW. --- dlls/shell32/shell32_En.rc | 1 + dlls/shell32/shell32_main.h | 1 + dlls/shell32/shfldr_fs.c | 2 +- dlls/shell32/shfldr_unixfs.c | 1 + dlls/shell32/shlfileop.c | 42 ++++++++++++++++++++++++++++++++++++++---- dlls/shell32/shresdef.h | 1 + 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc index a068538..03b31f6 100644 --- a/dlls/shell32/shell32_En.rc +++ b/dlls/shell32/shell32_En.rc @@ -168,6 +168,7 @@ STRINGTABLE DISCARDABLE IDS_TRASHITEM_TEXT "Are you sure that you want to send '%1' to the Trash?" IDS_TRASHFOLDER_TEXT "Are you sure that you want to send '%1' and all it's content to the Trash?" IDS_TRASHMULTIPLE_TEXT "Are you sure that you want to send these %1 items to the Trash?" + IDS_CANTTRASH_TEXT "The item '%1' can't be sent to Trash. Do you want to delete it instead?" IDS_OVERWRITEFILE_TEXT "OverWrite File %1?" IDS_OVERWRITEFILE_CAPTION "Confirm File OverWrite" diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index ab52096..5bc8e64 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -151,6 +151,7 @@ #define ASK_DELETE_SELECTED 6 #define ASK_TRASH_FILE 7 #define ASK_TRASH_FOLDER 8 #define ASK_TRASH_MULTIPLE_ITEM 9 +#define ASK_CANT_TRASH_ITEM 10 BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI); BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir); diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 4e1c878..dca38c2 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -1214,7 +1214,7 @@ ISFHelper_fnDeleteItems (ISFHelper * ifa op.hwnd = GetActiveWindow(); op.wFunc = FO_DELETE; op.pFrom = wszPathsList; - op.fFlags = 0; + op.fFlags = FOF_ALLOWUNDO; if (SHFileOperationW(&op)) { WARN("SHFileOperation failed\n"); diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 7d458b7..e679f6b 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -1810,6 +1810,7 @@ static HRESULT UNIXFS_delete_with_shfile op.hwnd = GetActiveWindow(); op.wFunc = FO_DELETE; op.pFrom = wszPathsList; + op.fFlags = FOF_ALLOWUNDO; if (!SHFileOperationW(&op)) { WARN("SHFileOperationW failed\n"); diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index d744689..dda59de 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -42,6 +42,7 @@ #include "shell32_main.h" #include "undocshell.h" #include "wine/unicode.h" #include "wine/debug.h" +#include "xdg.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -106,6 +107,11 @@ static BOOL SHELL_ConfirmIDs(int nKindOf ids->caption_resource_id = IDS_DELETEITEM_CAPTION; ids->text_resource_id = IDS_TRASHMULTIPLE_TEXT; return TRUE; + case ASK_CANT_TRASH_ITEM: + ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE; + ids->caption_resource_id = IDS_DELETEITEM_CAPTION; + ids->text_resource_id = IDS_CANTTRASH_TEXT; + return TRUE; case ASK_DELETE_SELECTED: ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE; ids->caption_resource_id = IDS_DELETEITEM_CAPTION; @@ -1104,12 +1110,17 @@ static HRESULT delete_files(LPSHFILEOPST FILE_ENTRY *fileEntry; DWORD i; BOOL bPathExists; + BOOL bTrash; if (!flFrom->dwNumFiles) return ERROR_SUCCESS; - if (!(lpFileOp->fFlags & FOF_NOCONFIRMATION) || (lpFileOp->fFlags & FOF_WANTNUKEWARNING)) - if (!confirm_delete_list(lpFileOp->hwnd, lpFileOp->fFlags, FALSE, flFrom)) + /* Windows also checks only the first item */ + bTrash = (lpFileOp->fFlags & FOF_ALLOWUNDO) + && TRASH_CanTrashFile(flFrom->feFiles[0].szFullPath); + + if (!(lpFileOp->fFlags & FOF_NOCONFIRMATION) || (!bTrash && lpFileOp->fFlags & FOF_WANTNUKEWARNING)) + if (!confirm_delete_list(lpFileOp->hwnd, lpFileOp->fFlags, bTrash, flFrom)) { lpFileOp->fAnyOperationsAborted = TRUE; return 0; @@ -1120,10 +1131,33 @@ static HRESULT delete_files(LPSHFILEOPST bPathExists = TRUE; fileEntry = &flFrom->feFiles[i]; + if (!IsAttribFile(fileEntry->attributes) && + (lpFileOp->fFlags & FOF_FILESONLY && fileEntry->bFromWildcard)) + continue; + + if (bTrash) + { + BOOL bDelete; + if (TRASH_TrashFile(fileEntry->szFullPath)) + continue; + + /* Note: Windows silently deletes the file in such a situation, we show a dialog */ + if (!(lpFileOp->fFlags & FOF_NOCONFIRMATION) || (lpFileOp->fFlags & FOF_WANTNUKEWARNING)) + bDelete = SHELL_ConfirmDialogW(lpFileOp->hwnd, ASK_CANT_TRASH_ITEM, fileEntry->szFullPath); + else + bDelete = TRUE; + + if (!bDelete) + { + lpFileOp->fAnyOperationsAborted = TRUE; + break; + } + } + /* delete the file or directory */ if (IsAttribFile(fileEntry->attributes)) bPathExists = DeleteFileW(fileEntry->szFullPath); - else if (!(lpFileOp->fFlags & FOF_FILESONLY && fileEntry->bFromWildcard)) + else bPathExists = SHELL_DeleteDirectoryW(lpFileOp->hwnd, fileEntry->szFullPath, FALSE); if (!bPathExists) @@ -1252,7 +1286,7 @@ static HRESULT rename_files(LPSHFILEOPST /* alert the user if an unsupported flag is used */ static void check_flags(FILEOP_FLAGS fFlags) { - WORD wUnsupportedFlags = FOF_ALLOWUNDO | FOF_NO_CONNECTED_ELEMENTS | + WORD wUnsupportedFlags = FOF_NO_CONNECTED_ELEMENTS | FOF_NOCOPYSECURITYATTRIBS | FOF_NORECURSEREPARSE | FOF_RENAMEONCOLLISION | FOF_WANTMAPPINGHANDLE; diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h index 2f85532..3f0e1d7 100644 --- a/dlls/shell32/shresdef.h +++ b/dlls/shell32/shresdef.h @@ -89,6 +89,7 @@ #define IDS_DELETESELECTED_TEXT 136 #define IDS_TRASHFOLDER_TEXT 137 #define IDS_TRASHITEM_TEXT 138 #define IDS_TRASHMULTIPLE_TEXT 139 +#define IDS_CANTTRASH_TEXT 140 /* browse for folder dialog box */ #define IDD_STATUS 0x3743
1
0
0
0
Mikołaj Zalewski : shell32: Add trashing support functions.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: f2686c7ce9f19bb02035e986fd24ded5d58da6e3 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f2686c7ce9f19bb02035e98…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Jul 19 18:36:42 2006 +0200 shell32: Add trashing support functions. --- dlls/shell32/Makefile.in | 4 dlls/shell32/trash.c | 308 ++++++++++++++++++++++++++++++++++++++ dlls/shell32/xdg.c | 372 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/shell32/xdg.h | 39 +++++ 4 files changed, 722 insertions(+), 1 deletions(-) create mode 100644 dlls/shell32/trash.c create mode 100644 dlls/shell32/xdg.c create mode 100644 dlls/shell32/xdg.h Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=f2686c7ce9f19bb0203…
1
0
0
0
Mikołaj Zalewski : shell32: Add trashing confirmations .
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: ca7de052b2d28656aedd00b1dc899503949f2391 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ca7de052b2d28656aedd00b…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Jul 19 18:36:22 2006 +0200 shell32: Add trashing confirmations. --- dlls/shell32/Makefile.in | 3 dlls/shell32/shell32_En.rc | 3 dlls/shell32/shell32_main.h | 3 dlls/shell32/shlfileop.c | 25 ++- dlls/shell32/shres.rc | 345 +++++++++++++++++++++++++++++++++++++++++++ dlls/shell32/shresdef.h | 26 ++- 6 files changed, 388 insertions(+), 17 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=ca7de052b2d28656aed…
1
0
0
0
Benjamin Arai : oleaut32: Move varformat conformance tests to new file varformat.c
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 63c26dac23323d94599efe70caf86cf3ba61b7c2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=63c26dac23323d94599efe7…
Author: Benjamin Arai <me(a)benjaminarai.com> Date: Mon Jul 31 00:25:32 2006 -0700 oleaut32: Move varformat conformance tests to new file varformat.c --- dlls/oleaut32/tests/Makefile.in | 1 dlls/oleaut32/tests/varformat.c | 401 +++++++++++++++++++++++++++++++++++++++ dlls/oleaut32/tests/vartest.c | 337 --------------------------------- 3 files changed, 402 insertions(+), 337 deletions(-) create mode 100644 dlls/oleaut32/tests/varformat.c Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=63c26dac23323d94599…
1
0
0
0
Vitaliy Margolen : user: Set buffer to '\0' in GetKeyNameTextA too.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 066e0d5b1b2b892d57896f34ad3b7d9e2c38bd00 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=066e0d5b1b2b892d57896f3…
Author: Vitaliy Margolen <wine-patch(a)kievinfo.com> Date: Sat Jul 29 19:28:26 2006 -0600 user: Set buffer to '\0' in GetKeyNameTextA too. --- dlls/user/input.c | 3 +++ dlls/user/tests/input.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dlls/user/input.c b/dlls/user/input.c index 26c3b96..24ffed7 100644 --- a/dlls/user/input.c +++ b/dlls/user/input.c @@ -595,7 +595,10 @@ INT WINAPI GetKeyNameTextA(LONG lParam, INT ret; if (!GetKeyNameTextW(lParam, buf, 256)) + { + lpBuffer[0] = 0; return 0; + } ret = WideCharToMultiByte(CP_ACP, 0, buf, -1, lpBuffer, nSize, NULL, NULL); if (!ret && nSize) { diff --git a/dlls/user/tests/input.c b/dlls/user/tests/input.c index 7627f42..f87be76 100644 --- a/dlls/user/tests/input.c +++ b/dlls/user/tests/input.c @@ -521,8 +521,22 @@ static void test_Input_blackbox(void) DestroyWindow(window); } +static void test_keynames(void) +{ + int i, len; + char buff[256]; + + for (i = 0; i < 512; i++) + { + strcpy(buff, "----"); + len = GetKeyNameTextA(i << 16, buff, sizeof(buff)); + ok(len || !buff[0], "%d: Buffer is not zeroed\n", i); + } +} + START_TEST(input) { test_Input_whitebox(); test_Input_blackbox(); + test_keynames(); }
1
0
0
0
Duane Clark : msvcrt: Fix _getw.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 88aeeb9fd838af4bb40669f561506b52785f60bd URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=88aeeb9fd838af4bb40669f…
Author: Duane Clark <fpga(a)pacbell.net> Date: Sat Jul 29 15:38:02 2006 -0700 msvcrt: Fix _getw. --- dlls/msvcrt/file.c | 34 +++++++++++++++++++--------------- dlls/msvcrt/tests/file.c | 4 ++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index a1bc07a..d5d9647 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1675,21 +1675,6 @@ int CDECL _read(int fd, void *buf, unsig } /********************************************************************* - * _getw (MSVCRT.@) - */ -int CDECL MSVCRT__getw(MSVCRT_FILE* file) -{ - int i; - switch (_read(file->_file, &i, sizeof(int))) - { - case 1: return i; - case 0: file->_flag |= MSVCRT__IOEOF; break; - default: file->_flag |= MSVCRT__IOERR; break; - } - return EOF; -} - -/********************************************************************* * _setmode (MSVCRT.@) */ int CDECL _setmode(int fd,int mode) @@ -2226,6 +2211,25 @@ MSVCRT_wint_t CDECL MSVCRT_fgetwc(MSVCRT } /********************************************************************* + * _getw (MSVCRT.@) + */ +int CDECL MSVCRT__getw(MSVCRT_FILE* file) +{ + char *ch; + int i, j, k; + ch = (char *)&i; + for (j=0; j<sizeof(int); j++) { + k = MSVCRT_fgetc(file); + if (k == MSVCRT_EOF) { + file->_flag |= MSVCRT__IOEOF; + return EOF; + } + ch[j] = k; + } + return i; +} + +/********************************************************************* * getwc (MSVCRT.@) */ MSVCRT_wint_t CDECL MSVCRT_getwc(MSVCRT_FILE* file) diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index e3f8ce5..b9387ce 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -227,7 +227,7 @@ static void test_readmode( BOOL ascii_mo ok(fgets(buffer,MSVCRT_BUFSIZ+256,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); i = _getw(file); ip = (int *)outbuffer; - todo_wine ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); + ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); for (fp=0; fp<strlen(outbuffer); fp++) if (outbuffer[fp] == '\n') break; fp++; @@ -239,7 +239,7 @@ static void test_readmode( BOOL ascii_mo } i = _getw(file); ip = (int *)buffer; - todo_wine ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); + ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); fclose (file); unlink ("fdopen.tst");
1
0
0
0
Duane Clark : msvcrt: Fix fread.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: b44ea8084d8b507ec1630d47fdcbf2f75225174a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b44ea8084d8b507ec1630d4…
Author: Duane Clark <fpga(a)pacbell.net> Date: Sat Jul 29 15:35:02 2006 -0700 msvcrt: Fix fread. --- dlls/msvcrt/file.c | 12 +++++++++--- dlls/msvcrt/tests/file.c | 10 ++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 0e677c7..a1bc07a 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2490,6 +2490,8 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *p memcpy(ptr, file->_ptr, pcnt); file->_cnt -= pcnt; file->_ptr += pcnt; + if (MSVCRT_fdesc[file->_file].wxflag & WX_TEXT) + pcnt -= remove_cr(ptr,pcnt); read += pcnt ; rcnt -= pcnt ; ptr = (char*)ptr + pcnt; @@ -2499,18 +2501,22 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *p } else return 0; } - if(rcnt) + while(rcnt>0) { - pread = _read(file->_file,ptr, rcnt); + int i = _read(file->_file,ptr, rcnt); + if (i==0) break; + pread += i; + rcnt -= i; /* expose feof condition in the flags * MFC tests file->_flag for feof, and doesn't not call feof()) */ if ( MSVCRT_fdesc[file->_file].wxflag & WX_ATEOF) file->_flag |= MSVCRT__IOEOF; - else if (pread == -1) + else if (i == -1) { file->_flag |= MSVCRT__IOERR; pread = 0; + rcnt = 0; } } read+=pread; diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 5eaf3eb..e3f8ce5 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -210,10 +210,7 @@ static void test_readmode( BOOL ascii_mo ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); j=strlen(outbuffer); i=fread(buffer,1,256,file); - if (ao == -1) - todo_wine todo_wine ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); - else - ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); + ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); l = ftell(file); ok(l == pl+j+1,"ftell after fread got %ld should be %d in %s\n", l, pl+j+1, IOMODE); /* fread should return the requested number of bytes if available */ @@ -222,10 +219,7 @@ static void test_readmode( BOOL ascii_mo ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); j = fp+10; i=fread(buffer,1,j,file); - if (ao == -1) - todo_wine ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); - else - ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); + ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); /* test some additional functions */ rewind(file);
1
0
0
0
Duane Clark : msvcrt: Fix _read and fgetc.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: b37b967add9ebb9fd406719996460892af6effb2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b37b967add9ebb9fd406719…
Author: Duane Clark <fpga(a)pacbell.net> Date: Sat Jul 29 15:27:59 2006 -0700 msvcrt: Fix _read and fgetc. --- dlls/msvcrt/file.c | 49 +++++++++++++++++++++++++++++++--------------- dlls/msvcrt/tests/file.c | 31 +++++++++++++---------------- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c598374..0e677c7 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1615,9 +1615,9 @@ static unsigned int remove_cr(char *buf, } /********************************************************************* - * _read (MSVCRT.@) + * (internal) read_i */ -int CDECL _read(int fd, void *buf, unsigned int count) +static int read_i(int fd, void *buf, unsigned int count) { DWORD num_read, all_read = 0; char *bufstart = buf; @@ -1641,17 +1641,11 @@ int CDECL _read(int fd, void *buf, unsig { TRACE(":EOF\n"); MSVCRT_fdesc[fd].wxflag |= WX_ATEOF; - if (MSVCRT_fdesc[fd].wxflag & WX_TEXT) - num_read -= remove_cr(bufstart+all_read,num_read); all_read += num_read; if (count > 4) TRACE("%s\n",debugstr_an(buf,all_read)); return all_read; } - if (MSVCRT_fdesc[fd].wxflag & WX_TEXT) - { - num_read -= remove_cr(bufstart+all_read,num_read); - } all_read += num_read; } else @@ -1667,6 +1661,20 @@ int CDECL _read(int fd, void *buf, unsig } /********************************************************************* + * _read (MSVCRT.@) + */ +int CDECL _read(int fd, void *buf, unsigned int count) +{ + int num_read; + num_read = read_i(fd, buf, count); + if (num_read>0 && MSVCRT_fdesc[fd].wxflag & WX_TEXT) + { + num_read -= remove_cr(buf,num_read); + } + return num_read; +} + +/********************************************************************* * _getw (MSVCRT.@) */ int CDECL MSVCRT__getw(MSVCRT_FILE* file) @@ -2109,13 +2117,13 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* fi if(file->_flag & MSVCRT__IONBF) { unsigned char c; int r; - if ((r = _read(file->_file,&c,1)) != 1) { + if ((r = read_i(file->_file,&c,1)) != 1) { file->_flag |= (r == 0) ? MSVCRT__IOEOF : MSVCRT__IOERR; return MSVCRT_EOF; } return c; } else { - file->_cnt = _read(file->_file, file->_base, file->_bufsiz); + file->_cnt = read_i(file->_file, file->_base, file->_bufsiz); if(file->_cnt<=0) { file->_flag |= (file->_cnt == 0) ? MSVCRT__IOEOF : MSVCRT__IOERR; file->_cnt = 0; @@ -2132,12 +2140,21 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* fi */ int CDECL MSVCRT_fgetc(MSVCRT_FILE* file) { - if (file->_cnt>0) { - file->_cnt--; - return *(unsigned char *)file->_ptr++; - } else { - return MSVCRT__filbuf(file); - } + char *i; + int j; + do { + if (file->_cnt>0) { + file->_cnt--; + i = file->_ptr++; + j = *i; + } else { + j = MSVCRT__filbuf(file); + if (j == MSVCRT_EOF) + return j; + } + if (!(MSVCRT_fdesc[file->_file].wxflag & WX_TEXT) || (j != '\r')) + return j; + } while(1); } /********************************************************************* diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 07eb8dc..5eaf3eb 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -184,10 +184,7 @@ static void test_readmode( BOOL ascii_mo fp++; ok(fgets(buffer,256,file) !=0,"line 1 fgets failed unexpected in %s\n", IOMODE); l = ftell(file); - if (ao == -1) - todo_wine ok(l == pl+fp,"line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); - else - ok(l == pl+fp,"line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(l == pl+fp,"line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); ok(lstrlenA(buffer) == fp+ao,"line 1 fgets got size %d should be %d in %s\n", lstrlenA(buffer), fp+ao, IOMODE); /* test a seek back across the buffer boundary */ @@ -197,19 +194,13 @@ static void test_readmode( BOOL ascii_mo ok(l == pl,"ftell after seek got %ld should be %d in %s\n", l, pl, IOMODE); ok(fgets(buffer,256,file) !=0,"second read of line 1 fgets failed unexpected in %s\n", IOMODE); l = ftell(file); - if (ao == -1) - todo_wine ok(l == pl+fp,"second read of line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); - else - ok(l == pl+fp,"second read of line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(l == pl+fp,"second read of line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); ok(lstrlenA(buffer) == fp+ao,"second read of line 1 fgets got size %d should be %d in %s\n", lstrlenA(buffer), fp+ao, IOMODE); ok(fgets(buffer,256,file) !=0,"line 2 fgets failed unexpected in %s\n", IOMODE); fp += 2; l = ftell(file); - if (ao == -1) - todo_wine ok(l == pl+fp,"line 2 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); - else - ok(l == pl+fp,"line 2 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(l == pl+fp,"line 2 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); ok(lstrlenA(buffer) == 2+ao,"line 2 fgets got size %d should be %d in %s\n", lstrlenA(buffer), 2+ao, IOMODE); @@ -219,7 +210,10 @@ static void test_readmode( BOOL ascii_mo ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); j=strlen(outbuffer); i=fread(buffer,1,256,file); - ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); + if (ao == -1) + todo_wine todo_wine ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); + else + ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); l = ftell(file); ok(l == pl+j+1,"ftell after fread got %ld should be %d in %s\n", l, pl+j+1, IOMODE); /* fread should return the requested number of bytes if available */ @@ -228,7 +222,10 @@ static void test_readmode( BOOL ascii_mo ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); j = fp+10; i=fread(buffer,1,j,file); - ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); + if (ao == -1) + todo_wine ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); + else + ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); /* test some additional functions */ rewind(file); @@ -370,7 +367,7 @@ static void test_file_write_read( void ) "problems with _O_BINARY _write / _read\n"); _close(tempfd); tempfd = _open(tempf,_O_RDONLY|_O_TEXT); /* open in TEXT mode */ - todo_wine ok(_read(tempfd,btext,i) == i-1, + ok(_read(tempfd,btext,i) == i-1, "_read _O_TEXT got bad length\n"); ok( memcmp(mytext,btext,i-1) == 0, "problems with _O_BINARY _write / _O_TEXT _read\n"); @@ -413,8 +410,8 @@ static void test_file_write_read( void ) ok(ret == 1 && *btext == '\n', "_read expected '\\n' got bad length: %d\n", ret); _lseek(tempfd, -3, FILE_END); ret = _read(tempfd,btext,2); - todo_wine ok(ret == 1 && *btext == 'e', "_read expected 'e' got \"%.*s\" bad length: %d\n", ret, btext, ret); - todo_wine ok(tell(tempfd) == 42, "bad position %lu expecting 42\n", tell(tempfd)); + ok(ret == 1 && *btext == 'e', "_read expected 'e' got \"%.*s\" bad length: %d\n", ret, btext, ret); + ok(tell(tempfd) == 42, "bad position %lu expecting 42\n", tell(tempfd)); _close(tempfd); ret = unlink(tempf);
1
0
0
0
Duane Clark : msvcrt: File read buffer tests.
by Alexandre Julliard
31 Jul '06
31 Jul '06
Module: wine Branch: refs/heads/master Commit: 1aa8db05a0f9f3b8b7e5dcf6cca86137c164fbe8 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=1aa8db05a0f9f3b8b7e5dcf…
Author: Duane Clark <fpga(a)pacbell.net> Date: Sat Jul 29 15:23:26 2006 -0700 msvcrt: File read buffer tests. --- dlls/msvcrt/tests/file.c | 161 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 127 insertions(+), 34 deletions(-) diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 925b748..07eb8dc 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -32,6 +32,7 @@ #include <winbase.h> #include <winnls.h> #include <process.h> #include <errno.h> +#include "msvcrt.h" static void test_fdopen( void ) { @@ -132,53 +133,124 @@ static void test_fileops( void ) unlink ("fdopen.tst"); } -static void test_asciifileops( void ) +#define IOMODE (ao?"ascii mode":"binary mode") +static void test_readmode( BOOL ascii_mode ) { static const char outbuffer[] = "0,1,2,3,4,5,6,7,8,9\r\n\r\nA,B,C,D,E\r\nX,Y,Z"; - char buffer[256]; + static const char padbuffer[] = "ghjghjghjghj"; + static const char nlbuffer[] = "\r\n"; + char buffer[MSVCRT_BUFSIZ+256]; int fd; FILE *file; - int i; + int i, j, fp, ao, *ip, pl; long l; fd = open ("fdopen.tst", O_WRONLY | O_CREAT | O_BINARY, _S_IREAD |_S_IWRITE); + /* an internal buffer of MSVCRT_BUFSIZ is maintained, so make a file big + * enough to test operations that cross the buffer boundary + */ + j = (MSVCRT_BUFSIZ-4)/strlen(padbuffer); + for (i=0; i<j; i++) + write (fd, padbuffer, strlen(padbuffer)); + j = (MSVCRT_BUFSIZ-4)%strlen(padbuffer); + for (i=0; i<j; i++) + write (fd, &padbuffer[i], 1); + write (fd, nlbuffer, strlen(nlbuffer)); write (fd, outbuffer, sizeof (outbuffer)); close (fd); - /* Open file in ascii mode */ - fd = open ("fdopen.tst", O_RDONLY); - file = fdopen (fd, "rb"); - ok(strlen(outbuffer) == (sizeof(outbuffer)-1),"strlen/sizeof error\n"); - ok(ftell(file) == 0,"Did not start at beginning of file\n"); - ok(fgets(buffer,sizeof(buffer),file) !=0,"line 1 fgets failed unexpected\n"); - ok(fgets(buffer,sizeof(buffer),file) !=0,"line 2 fgets failed unexpected\n"); - ok(fgets(buffer,sizeof(buffer),file) !=0,"line 3 fgets failed unexpected\n"); - ok(fgets(buffer,sizeof(buffer),file) !=0,"line 4 fgets failed unexpected\n"); - ok(fgets(buffer,sizeof(buffer),file) ==0,"fgets didn't signal EOF\n"); - ok(feof(file) !=0,"feof doesn't signal EOF\n"); - rewind(file); - ok(ftell(file) == 0,"Did not rewind to beginning of file\n"); - for (i=0; i<strlen(outbuffer); i++) - if (outbuffer[i] == '\n') break; - i++; - ok(fgets(buffer,strlen(outbuffer),file) !=0,"line 1 fgets failed unexpected\n"); + if (ascii_mode) { + /* Open file in ascii mode */ + fd = open ("fdopen.tst", O_RDONLY); + file = fdopen (fd, "r"); + ao = -1; /* on offset to account for carriage returns */ + } + else { + fd = open ("fdopen.tst", O_RDONLY | O_BINARY); + file = fdopen (fd, "rb"); + ao = 0; + } + + /* first is a test of fgets, ftell, fseek */ + ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE); + ok(fgets(buffer,MSVCRT_BUFSIZ+256,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); + l = ftell(file); + pl = MSVCRT_BUFSIZ-2; + ok(l == pl,"padding line ftell got %ld should be %d in %s\n", l, pl, IOMODE); + ok(lstrlenA(buffer) == pl+ao,"padding line fgets got size %d should be %d in %s\n", + lstrlenA(buffer), pl+ao, IOMODE); + for (fp=0; fp<strlen(outbuffer); fp++) + if (outbuffer[fp] == '\n') break; + fp++; + ok(fgets(buffer,256,file) !=0,"line 1 fgets failed unexpected in %s\n", IOMODE); l = ftell(file); - todo_wine ok(l == i,"line 1 ftell got %ld should be %d\n", l, i); - ok(lstrlenA(buffer) == i-1,"line 1 fgets got size %d should be %d\n", lstrlenA(buffer), i-1); - ok(fgets(buffer,sizeof(outbuffer),file) !=0,"line 2 fgets failed unexpected\n"); - i += 2; + if (ao == -1) + todo_wine ok(l == pl+fp,"line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + else + ok(l == pl+fp,"line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(lstrlenA(buffer) == fp+ao,"line 1 fgets got size %d should be %d in %s\n", + lstrlenA(buffer), fp+ao, IOMODE); + /* test a seek back across the buffer boundary */ + l = pl; + ok(fseek(file,l,SEEK_SET)==0,"seek failure in %s\n", IOMODE); l = ftell(file); - todo_wine ok(l == i,"line 2 ftell got %ld should be %d\n", l, i); - ok(lstrlenA(buffer) == 1,"line 2 fgets got size %d should be %d\n", lstrlenA(buffer), 1); - ok(fgets(buffer,sizeof(outbuffer),file) !=0,"line 3 fgets failed unexpected\n"); - for (; i<strlen(outbuffer); i++) - if (outbuffer[i] == '\n') break; - i++; + ok(l == pl,"ftell after seek got %ld should be %d in %s\n", l, pl, IOMODE); + ok(fgets(buffer,256,file) !=0,"second read of line 1 fgets failed unexpected in %s\n", IOMODE); l = ftell(file); - ok(l == i,"line 3 ftell got %ld should be %d\n", l, i); + if (ao == -1) + todo_wine ok(l == pl+fp,"second read of line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + else + ok(l == pl+fp,"second read of line 1 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(lstrlenA(buffer) == fp+ao,"second read of line 1 fgets got size %d should be %d in %s\n", + lstrlenA(buffer), fp+ao, IOMODE); + ok(fgets(buffer,256,file) !=0,"line 2 fgets failed unexpected in %s\n", IOMODE); + fp += 2; + l = ftell(file); + if (ao == -1) + todo_wine ok(l == pl+fp,"line 2 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + else + ok(l == pl+fp,"line 2 ftell got %ld should be %d in %s\n", l, pl+fp, IOMODE); + ok(lstrlenA(buffer) == 2+ao,"line 2 fgets got size %d should be %d in %s\n", + lstrlenA(buffer), 2+ao, IOMODE); - fclose (file); + /* test fread across buffer boundary */ + rewind(file); + ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE); + ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); + j=strlen(outbuffer); + i=fread(buffer,1,256,file); + ok(i==j+6+ao*4,"fread failed, expected %d got %d in %s\n", j+6+ao*4, i, IOMODE); + l = ftell(file); + ok(l == pl+j+1,"ftell after fread got %ld should be %d in %s\n", l, pl+j+1, IOMODE); + /* fread should return the requested number of bytes if available */ + rewind(file); + ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE); + ok(fgets(buffer,MSVCRT_BUFSIZ-6,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); + j = fp+10; + i=fread(buffer,1,j,file); + ok(i==j,"fread failed, expected %d got %d in %s\n", j, i, IOMODE); + + /* test some additional functions */ + rewind(file); + ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE); + ok(fgets(buffer,MSVCRT_BUFSIZ+256,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); + i = _getw(file); + ip = (int *)outbuffer; + todo_wine ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); + for (fp=0; fp<strlen(outbuffer); fp++) + if (outbuffer[fp] == '\n') break; + fp++; + /* this will cause the next _getw to cross carriage return characters */ + ok(fgets(buffer,fp-6,file) !=0,"line 1 fgets failed unexpected in %s\n", IOMODE); + for (i=0, j=0; i<6; i++) { + if (ao==0 || outbuffer[fp-3+i] != '\r') + buffer[j++] = outbuffer[fp-3+i]; + } + i = _getw(file); + ip = (int *)buffer; + todo_wine ok(i == *ip,"_getw failed, expected %08x got %08x in %s\n", *ip, i, IOMODE); + fclose (file); unlink ("fdopen.tst"); } @@ -280,9 +352,29 @@ static void test_file_write_read( void ) static const char mytext[]= "This is test_file_write_read\nsecond line\n"; static const char dostext[]= "This is test_file_write_read\r\nsecond line\r\n"; char btext[LLEN]; - int ret; + int ret, i; tempf=_tempnam(".","wne"); + tempfd = _open(tempf,_O_CREAT|_O_TRUNC|_O_BINARY|_O_RDWR, + _S_IREAD | _S_IWRITE); + ok( tempfd != -1, + "Can't open '%s': %d\n", tempf, errno); /* open in BINARY mode */ + ok(_write(tempfd,dostext,strlen(dostext)) == lstrlenA(dostext), + "_write _O_BINARY bad return value\n"); + _close(tempfd); + i = lstrlenA(mytext); + tempfd = _open(tempf,_O_RDONLY|_O_BINARY,0); /* open in BINARY mode */ + ok(_read(tempfd,btext,i) == i, + "_read _O_BINARY got bad length\n"); + ok( memcmp(dostext,btext,i) == 0, + "problems with _O_BINARY _write / _read\n"); + _close(tempfd); + tempfd = _open(tempf,_O_RDONLY|_O_TEXT); /* open in TEXT mode */ + todo_wine ok(_read(tempfd,btext,i) == i-1, + "_read _O_TEXT got bad length\n"); + ok( memcmp(mytext,btext,i-1) == 0, + "problems with _O_BINARY _write / _O_TEXT _read\n"); + _close(tempfd); tempfd = _open(tempf,_O_CREAT|_O_TRUNC|_O_TEXT|_O_RDWR, _S_IREAD | _S_IWRITE); ok( tempfd != -1, @@ -556,7 +648,8 @@ START_TEST(file) test_fdopen(); test_fopen_fclose_fcloseall(); test_fileops(); - test_asciifileops(); + test_readmode(FALSE); /* binary mode */ + test_readmode(TRUE); /* ascii mode */ test_fgetwc(); test_file_put_get(); test_tmpnam();
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
86
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
86
Results per page:
10
25
50
100
200