ReactOS.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
2024
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
List overview
Download
Ros-diffs
July 2016
----- 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
ros-diffs@reactos.org
18 participants
358 discussions
Start a n
N
ew thread
[jimtabor] 71916: [NtUser] - Fix crash in User32:win:test_winproc_handles. See CORE-11368.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Jul 13 03:04:20 2016 New Revision: 71916 URL:
http://svn.reactos.org/svn/reactos?rev=71916&view=rev
Log: [NtUser] - Fix crash in User32:win:test_winproc_handles. See CORE-11368. Modified: trunk/reactos/win32ss/user/ntuser/callproc.c Modified: trunk/reactos/win32ss/user/ntuser/callproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/callpr…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] Wed Jul 13 03:04:20 2016 @@ -50,7 +50,7 @@ } /* Release the extra reference (UserCreateObject added 2 references) */ - UserDereferenceObject(NewCallProc); + if (NewCallProc != NULL) UserDereferenceObject(NewCallProc); return NewCallProc; }
8 years, 4 months
1
0
0
0
[jimtabor] 71915: [User32] - Fix regression in API:RealGetWindowClass test due to wine sync/port. - ReactOS use of DIALOG_get_info is an enhanced fork of the same wine function.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Jul 13 00:40:07 2016 New Revision: 71915 URL:
http://svn.reactos.org/svn/reactos?rev=71915&view=rev
Log: [User32] - Fix regression in API:RealGetWindowClass test due to wine sync/port. - ReactOS use of DIALOG_get_info is an enhanced fork of the same wine function. Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Wed Jul 13 00:40:07 2016 @@ -1678,7 +1678,7 @@ BOOL result = FALSE; /* Perform DIALOGINFO initialization if not done */ - if(!(dlgInfo = DIALOG_get_info( hDlg, Msg == WM_NCCREATE ))) return 0; + if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0; //// REACTOS : Always TRUE! See RealGetWindowClass. SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 ); @@ -1738,7 +1738,7 @@ BOOL result = FALSE; /* Perform DIALOGINFO initialization if not done */ - if(!(dlgInfo = DIALOG_get_info( hDlg, Msg == WM_NCCREATE ))) return 0; + if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0; //// REACTOS : Always TRUE! See RealGetWindowClass. SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
8 years, 4 months
1
0
0
0
[hbelusca] 71914: [CONCFG]: Add needed inclusion for StrSafe functions.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 00:09:36 2016 New Revision: 71914 URL:
http://svn.reactos.org/svn/reactos?rev=71914&view=rev
Log: [CONCFG]: Add needed inclusion for StrSafe functions. Modified: trunk/reactos/win32ss/user/winsrv/concfg/settings.c Modified: trunk/reactos/win32ss/user/winsrv/concfg/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/concfg…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/concfg/settings.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/concfg/settings.c [iso-8859-1] Wed Jul 13 00:09:36 2016 @@ -36,6 +36,7 @@ #include "settings.h" #include <stdio.h> // for swprintf +#include <strsafe.h> #define NDEBUG #include <debug.h>
8 years, 4 months
1
0
0
0
[hbelusca] 71913: [CONSRV] - Fix potential Out-of-bounds access during string copy/concatenation. CID 1322098. - Fix check for NULL after potential dereference. CID 1322175.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 00:06:09 2016 New Revision: 71913 URL:
http://svn.reactos.org/svn/reactos?rev=71913&view=rev
Log: [CONSRV] - Fix potential Out-of-bounds access during string copy/concatenation. CID 1322098. - Fix check for NULL after potential dereference. CID 1322175. Modified: trunk/reactos/win32ss/user/winsrv/concfg/settings.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c Modified: trunk/reactos/win32ss/user/winsrv/concfg/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/concfg…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/concfg/settings.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/concfg/settings.c [iso-8859-1] Wed Jul 13 00:06:09 2016 @@ -102,13 +102,12 @@ wLength = GetWindowsDirectoryW(DestString, MaxStrLen); if ((wLength > 0) && (_wcsnicmp(ConsoleName, DestString, wLength) == 0)) { - wcsncpy(DestString, L"%SystemRoot%", MaxStrLen); - // FIXME: Fix possible buffer overflows there !!!!! - wcsncat(DestString, ConsoleName + wLength, MaxStrLen); + StringCchCopyW(DestString, MaxStrLen, L"%SystemRoot%"); + StringCchCatW(DestString, MaxStrLen, ConsoleName + wLength); } else { - wcsncpy(DestString, ConsoleName, MaxStrLen); + StringCchCopyW(DestString, MaxStrLen, ConsoleName); } /* Replace path separators (backslashes) by underscores */ @@ -155,10 +154,10 @@ * to make the registry happy, replace all the * backslashes by underscores. */ - TranslateConsoleName(szBuffer2, ConsoleTitle, MAX_PATH); + TranslateConsoleName(szBuffer2, ConsoleTitle, ARRAYSIZE(szBuffer2)); /* Create the registry path */ - wcsncat(szBuffer, szBuffer2, MAX_PATH - wcslen(szBuffer) - 1); + StringCchCatW(szBuffer, MAX_PATH - wcslen(szBuffer) - 1, szBuffer2); /* Create or open the registry key */ if (Create) Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Wed Jul 13 00:06:09 2016 @@ -1455,24 +1455,22 @@ { PGUI_CONSOLE_DATA GuiData = GuiGetGuiData(hWnd); - if (GuiData->IsWindowVisible) - { - KillTimer(hWnd, CONGUI_UPDATE_TIMER); - } + /* Free the GuiData registration */ + SetWindowLongPtrW(hWnd, GWLP_USERDATA, (DWORD_PTR)NULL); GetSystemMenu(hWnd, TRUE); if (GuiData) { + if (GuiData->IsWindowVisible) + KillTimer(hWnd, CONGUI_UPDATE_TIMER); + /* Free the terminal framebuffer */ if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); DeleteFonts(GuiData); } - - /* Free the GuiData registration */ - SetWindowLongPtrW(hWnd, GWLP_USERDATA, (DWORD_PTR)NULL); return DefWindowProcW(hWnd, WM_NCDESTROY, 0, 0); }
8 years, 4 months
1
0
0
0
[hbelusca] 71912: [SHELL32] - Use StringCbCopyW [PROGMAN] - Use StringCbCopyW: CID #1363712. - Don't read registry values in a registry key if we failed to open it. CID #514350.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jul 12 23:00:50 2016 New Revision: 71912 URL:
http://svn.reactos.org/svn/reactos?rev=71912&view=rev
Log: [SHELL32] - Use StringCbCopyW [PROGMAN] - Use StringCbCopyW: CID #1363712. - Don't read registry values in a registry key if we failed to open it. CID #514350. Modified: trunk/reactos/base/shell/progman/dialog.c trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp Modified: trunk/reactos/base/shell/progman/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/dialog.…
============================================================================== --- trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] Tue Jul 12 23:00:50 2016 @@ -516,7 +516,7 @@ if (IS_INTRESOURCE(lpszName)) swprintf(szName, L"%u", lpszName); else - wcscpy(szName, lpszName); + StringCbCopyW(szName, sizeof(szName), lpszName); hIcon = (HICON)LoadImageW(hModule, lpszName, IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); if (hIcon == NULL) @@ -1026,6 +1026,9 @@ DWORD dwSize; DWORD dwType; + ExecuteContext.hKeyPMRecentFilesList = NULL; + ExecuteContext.bCheckBinaryType = TRUE; + lRet = RegCreateKeyExW(Globals.hKeyProgMan, L"Recent File List", 0, @@ -1035,39 +1038,42 @@ NULL, &ExecuteContext.hKeyPMRecentFilesList, NULL); - - dwSize = sizeof(ExecuteContext.dwMaxFiles); - lRet = RegQueryValueExW(ExecuteContext.hKeyPMRecentFilesList, - L"Max Files", - NULL, - &dwType, - (LPBYTE)&ExecuteContext.dwMaxFiles, - &dwSize); - if (lRet != ERROR_SUCCESS || dwType != REG_DWORD) - { - ExecuteContext.dwMaxFiles = 4; + if (lRet == ERROR_SUCCESS) + { dwSize = sizeof(ExecuteContext.dwMaxFiles); - lRet = RegSetValueExW(ExecuteContext.hKeyPMRecentFilesList, - L"Max Files", - 0, - REG_DWORD, - (LPBYTE)&ExecuteContext.dwMaxFiles, - sizeof(ExecuteContext.dwMaxFiles)); + lRet = RegQueryValueExW(ExecuteContext.hKeyPMRecentFilesList, + L"Max Files", + NULL, + &dwType, + (LPBYTE)&ExecuteContext.dwMaxFiles, + &dwSize); + if (lRet != ERROR_SUCCESS || dwType != REG_DWORD) + { + ExecuteContext.dwMaxFiles = 4; + dwSize = sizeof(ExecuteContext.dwMaxFiles); + lRet = RegSetValueExW(ExecuteContext.hKeyPMRecentFilesList, + L"Max Files", + 0, + REG_DWORD, + (LPBYTE)&ExecuteContext.dwMaxFiles, + sizeof(ExecuteContext.dwMaxFiles)); + } + + dwSize = sizeof(ExecuteContext.bCheckBinaryType); + lRet = RegQueryValueExW(Globals.hKeyPMSettings, + L"CheckBinaryType", + NULL, + &dwType, + (LPBYTE)&ExecuteContext.bCheckBinaryType, + &dwSize); + if (lRet != ERROR_SUCCESS || dwType != REG_DWORD) + { + ExecuteContext.bCheckBinaryType = TRUE; + } } - dwSize = sizeof(ExecuteContext.bCheckBinaryType); - lRet = RegQueryValueExW(Globals.hKeyPMSettings, - L"CheckBinaryType", - NULL, - &dwType, - (LPBYTE)&ExecuteContext.bCheckBinaryType, - &dwSize); - if (lRet != ERROR_SUCCESS || dwType != REG_DWORD) - { - ExecuteContext.bCheckBinaryType = TRUE; - } - DialogBoxParamW(Globals.hInstance, MAKEINTRESOURCEW(IDD_EXECUTE), Globals.hMainWnd, DIALOG_EXECUTE_DlgProc, (LPARAM)&ExecuteContext); - RegCloseKey(ExecuteContext.hKeyPMRecentFilesList); -} + if (ExecuteContext.hKeyPMRecentFilesList) + RegCloseKey(ExecuteContext.hKeyPMRecentFilesList); +} Modified: trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] Tue Jul 12 23:00:50 2016 @@ -64,7 +64,7 @@ if (IS_INTRESOURCE(lpszName)) swprintf(szName, L"%u", (DWORD)lpszName); else - wcscpy(szName, (WCHAR*)lpszName); + StringCbCopyW(szName, sizeof(szName), lpszName); hIcon = LoadIconW(hModule, lpszName); if (hIcon == NULL)
8 years, 4 months
1
0
0
0
[hbelusca] 71911: [USETUP] - Don't hardcode buffer string size in GetPartTypeStringFromPartitionType calls. - Possibly check whether the first character of the PartTypeString string is NULL before ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jul 12 22:30:55 2016 New Revision: 71911 URL:
http://svn.reactos.org/svn/reactos?rev=71911&view=rev
Log: [USETUP] - Don't hardcode buffer string size in GetPartTypeStringFromPartitionType calls. - Possibly check whether the first character of the PartTypeString string is NULL before printing a generic partition information in case the partition type is unknown. We might check instead for the STRING_FORMATUNKNOWN string... - Don't check for PartTypeString being NULL since it's not a pointer. CID #1363481 and CID #1363494. Modified: trunk/reactos/base/setup/usetup/interface/usetup.c trunk/reactos/base/setup/usetup/partlist.c Modified: trunk/reactos/base/setup/usetup/interface/usetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Tue Jul 12 22:30:55 2016 @@ -2403,7 +2403,7 @@ ULONGLONG DiskSize; ULONGLONG PartSize; PCHAR Unit; - CHAR PartType[32]; + CHAR PartTypeString[32]; if (PartitionList == NULL || PartitionList->CurrentDisk == NULL || @@ -2418,7 +2418,9 @@ MUIDisplayPage(DELETE_PARTITION_PAGE); - GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartType, 30); + GetPartTypeStringFromPartitionType(PartEntry->PartitionType, + PartTypeString, + ARRAYSIZE(PartTypeString)); PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 @@ -2440,7 +2442,7 @@ Unit = MUIGetString(STRING_KB); } - if (PartType == NULL) + if (*PartTypeString == '\0') // STRING_FORMATUNKNOWN ?? { CONSOLE_PrintTextXY(6, 10, MUIGetString(STRING_HDDINFOUNK2), @@ -2456,7 +2458,7 @@ " %c%c %s %I64u %s", (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', - PartType, + PartTypeString, PartSize, Unit); } @@ -2696,7 +2698,9 @@ } /* adjust partition type */ - GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartTypeString, 30); + GetPartTypeStringFromPartitionType(PartEntry->PartitionType, + PartTypeString, + ARRAYSIZE(PartTypeString)); if (PartEntry->AutoCreate == TRUE) { @@ -2707,7 +2711,7 @@ PartEntry->PartitionNumber, PartSize, PartUnit, - PartType); + PartTypeString); #endif CONSOLE_PrintTextXY(8, 10, MUIGetString(STRING_HDINFOPARTZEROED), @@ -2750,7 +2754,7 @@ { CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_INSTALLONPART)); - if (PartTypeString == NULL) + if (*PartTypeString == '\0') // STRING_FORMATUNKNOWN ?? { CONSOLE_PrintTextXY(8, 10, MUIGetString(STRING_HDDINFOUNK4), Modified: trunk/reactos/base/setup/usetup/partlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Tue Jul 12 22:30:55 2016 @@ -1672,7 +1672,7 @@ { GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartTypeString, - 30); + ARRAYSIZE(PartTypeString)); PartType = PartTypeString; }
8 years, 4 months
1
0
0
0
[akhaldi] 71910: [KERNEL32_WINETEST] Sync with Wine Staging 1.9.14 except thread tests. CORE-11511
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 12 21:10:24 2016 New Revision: 71910 URL:
http://svn.reactos.org/svn/reactos?rev=71910&view=rev
Log: [KERNEL32_WINETEST] Sync with Wine Staging 1.9.14 except thread tests. CORE-11511 Modified: trunk/rostests/winetests/kernel32/codepage.c trunk/rostests/winetests/kernel32/comm.c trunk/rostests/winetests/kernel32/console.c trunk/rostests/winetests/kernel32/directory.c trunk/rostests/winetests/kernel32/file.c trunk/rostests/winetests/kernel32/loader.c trunk/rostests/winetests/kernel32/locale.c trunk/rostests/winetests/kernel32/path.c trunk/rostests/winetests/kernel32/pipe.c trunk/rostests/winetests/kernel32/process.c trunk/rostests/winetests/kernel32/sync.c trunk/rostests/winetests/kernel32/virtual.c Modified: trunk/rostests/winetests/kernel32/codepage.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/codepa…
============================================================================== --- trunk/rostests/winetests/kernel32/codepage.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/codepage.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -1139,8 +1139,8 @@ static void test_dbcs_to_widechar(void) { int i, count, count2; - WCHAR wbuf[2]; - unsigned char buf[] = {0xbf, 0xb4, 0xc7}; + WCHAR wbuf[5]; + unsigned char buf[] = {0xbf, 0xb4, 0xc7, '\0', 'x'}; static const DWORD flags[] = { MB_PRECOMPOSED, MB_COMPOSITE, @@ -1157,8 +1157,7 @@ for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i) { - wbuf[0] = 0xffff; - wbuf[1] = 0xffff; + memset(wbuf, 0xff, sizeof(wbuf)); count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 2, NULL, 0); count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 2, wbuf, count); @@ -1170,8 +1169,7 @@ for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i) { - wbuf[0] = 0xffff; - wbuf[1] = 0xffff; + memset(wbuf, 0xff, sizeof(wbuf)); count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 3, NULL, 0); SetLastError( 0xdeadbeef ); count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 3, wbuf, count); @@ -1190,6 +1188,65 @@ ok(wbuf[0] == 0x770b, "%04x: returned %04x (expected 770b)\n", flags[i], wbuf[0]); ok(wbuf[1] == 0x003f || broken(wbuf[1] == 0), /*windows xp*/ "%04x: wrong wide char: %04x\n", flags[i], wbuf[1]); + ok(wbuf[2] == 0xffff, "%04x: returned %04x (expected ffff)\n", flags[i], wbuf[2]); + } + } + + /* src ends with null character */ + for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i) + { + memset(wbuf, 0xff, sizeof(wbuf)); + count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 4, NULL, 0); + SetLastError( 0xdeadbeef ); + count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 4, wbuf, count); + ok(count == count2, "%04x: returned %d (expected %d)\n", flags[i], count2, count); + + if (flags[i] & MB_ERR_INVALID_CHARS) + { + ok(count == 0, "%04x: returned %d (expected 0)\n", flags[i], count); + ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04x: returned %d (expected %d)\n", + flags[i], GetLastError(), ERROR_NO_UNICODE_TRANSLATION); + } + else + { + WCHAR wbuf_ok[] = { 0x770b, 0x003f, '\0', 0xffff }; + WCHAR wbuf_broken[] = { 0x770b, '\0', 0xffff, 0xffff }; + ok(count == 3 || broken(count == 2 /*windows xp*/), + "%04x: returned %d (expected 3)\n", flags[i], count); + ok(!memcmp(wbuf, wbuf_ok, sizeof(wbuf_ok)) + || broken(!memcmp(wbuf, wbuf_broken, sizeof(wbuf_broken))), + "%04x: returned %04x %04x %04x %04x (expected %04x %04x %04x %04x)\n", + flags[i], wbuf[0], wbuf[1], wbuf[2], wbuf[3], + wbuf_ok[0], wbuf_ok[1], wbuf_ok[2], wbuf_ok[3]); + } + } + + /* src has null character, but not ends with it */ + for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i) + { + memset(wbuf, 0xff, sizeof(wbuf)); + count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 5, NULL, 0); + SetLastError( 0xdeadbeef ); + count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 5, wbuf, count); + ok(count == count2, "%04x: returned %d (expected %d)\n", flags[i], count2, count); + + if (flags[i] & MB_ERR_INVALID_CHARS) + { + ok(count == 0, "%04x: returned %d (expected 0)\n", flags[i], count); + ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04x: returned %d (expected %d)\n", + flags[i], GetLastError(), ERROR_NO_UNICODE_TRANSLATION); + } + else + { + WCHAR wbuf_ok[] = { 0x770b, 0x003f, '\0', 'x', 0xffff }; + WCHAR wbuf_broken[] = { 0x770b, '\0', 'x', 0xffff, 0xffff }; + ok(count == 4 || broken(count == 3), + "%04x: returned %d (expected 4)\n", flags[i], count); + ok(!memcmp(wbuf, wbuf_ok, sizeof(wbuf_ok)) + || broken(!memcmp(wbuf, wbuf_broken, sizeof(wbuf_broken))), + "%04x: returned %04x %04x %04x %04x %04x (expected %04x %04x %04x %04x %04x)\n", + flags[i], wbuf[0], wbuf[1], wbuf[2], wbuf[3], wbuf[4], + wbuf_ok[0], wbuf_ok[1], wbuf_ok[2], wbuf_ok[3], wbuf_ok[4]); } } } Modified: trunk/rostests/winetests/kernel32/comm.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/comm.c…
============================================================================== --- trunk/rostests/winetests/kernel32/comm.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/comm.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -2151,13 +2151,9 @@ iob.Information = -1; offset.QuadPart = (LONGLONG)i; status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); - /* FIXME: Remove once Wine is fixed */ - if (status == STATUS_PENDING) WaitForSingleObject(hcom, TIMEOUT); if (i >= 0) { -todo_wine ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status); -todo_wine ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status); ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information); } Modified: trunk/rostests/winetests/kernel32/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/consol…
============================================================================== --- trunk/rostests/winetests/kernel32/console.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/console.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -2779,6 +2779,165 @@ pSetConsoleFont(std_output, index); /* restore original font size */ } +static void test_GetConsoleFontInfo(HANDLE std_output) +{ + HANDLE hmod; + BOOL (WINAPI *pGetConsoleFontInfo)(HANDLE, BOOL, DWORD, CONSOLE_FONT_INFO *); + DWORD (WINAPI *pGetNumberOfConsoleFonts)(void); + DWORD num_fonts, index, i; + int memsize, win_width, win_height, tmp_w, tmp_h; + CONSOLE_FONT_INFO *cfi; + BOOL ret; + CONSOLE_SCREEN_BUFFER_INFO csbi; + COORD orig_sb_size, tmp_sb_size, orig_font, tmp_font; + + hmod = GetModuleHandleA("kernel32.dll"); + pGetConsoleFontInfo = (void *)GetProcAddress(hmod, "GetConsoleFontInfo"); + if (!pGetConsoleFontInfo) + { + win_skip("GetConsoleFontInfo is not available\n"); + return; + } + + pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); + if (!pGetNumberOfConsoleFonts) + { + win_skip("GetNumberOfConsoleFonts is not available\n"); + return; + } + + num_fonts = pGetNumberOfConsoleFonts(); + memsize = num_fonts * sizeof(CONSOLE_FONT_INFO); + cfi = HeapAlloc(GetProcessHeap(), 0, memsize); + memset(cfi, 0, memsize); + + GetConsoleScreenBufferInfo(std_output, &csbi); + orig_sb_size = csbi.dwSize; + tmp_sb_size.X = csbi.dwSize.X + 3; + tmp_sb_size.Y = csbi.dwSize.Y + 5; + SetConsoleScreenBufferSize(std_output, tmp_sb_size); + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(NULL, FALSE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), FALSE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(std_output, FALSE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + GetConsoleScreenBufferInfo(std_output, &csbi); + win_width = csbi.srWindow.Right - csbi.srWindow.Left + 1; + win_height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; + + GetCurrentConsoleFont(std_output, FALSE, &cfi[0]); + index = cfi[0].nFont; + orig_font = GetConsoleFontSize(std_output, index); + + memset(cfi, 0, memsize); + ret = pGetConsoleFontInfo(std_output, FALSE, num_fonts, cfi); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + + todo_wine ok(cfi[index].dwFontSize.X == win_width, "got %d, expected %d\n", + cfi[index].dwFontSize.X, win_width); + todo_wine ok(cfi[index].dwFontSize.Y == win_height, "got %d, expected %d\n", + cfi[index].dwFontSize.Y, win_height); + + for (i = 0; i < num_fonts; i++) + { + ok(cfi[i].nFont == i, "element out of order, got nFont %d, expected %d\n", cfi[i].nFont, i); + tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); + tmp_w = (double)orig_font.X / tmp_font.X * win_width; + tmp_h = (double)orig_font.Y / tmp_font.Y * win_height; + todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); + todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); + } + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(NULL, TRUE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), TRUE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleFontInfo(std_output, TRUE, 0, cfi); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + memset(cfi, 0, memsize); + ret = pGetConsoleFontInfo(std_output, TRUE, num_fonts, cfi); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + + todo_wine ok(cfi[index].dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n", + cfi[index].dwFontSize.X, csbi.dwMaximumWindowSize.X); + todo_wine ok(cfi[index].dwFontSize.Y == csbi.dwMaximumWindowSize.Y, "got %d, expected %d\n", + cfi[index].dwFontSize.Y, csbi.dwMaximumWindowSize.Y); + + for (i = 0; i < num_fonts; i++) + { + ok(cfi[i].nFont == i, "element out of order, got nFont %d, expected %d\n", cfi[i].nFont, i); + tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); + tmp_w = (double)orig_font.X / tmp_font.X * csbi.dwMaximumWindowSize.X; + tmp_h = (double)orig_font.Y / tmp_font.Y * csbi.dwMaximumWindowSize.Y; + todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); + todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); + } + + HeapFree(GetProcessHeap(), 0, cfi); + SetConsoleScreenBufferSize(std_output, orig_sb_size); +} + +static void test_SetConsoleFont(HANDLE std_output) +{ + HANDLE hmod; + BOOL (WINAPI *pSetConsoleFont)(HANDLE, DWORD); + BOOL ret; + DWORD (WINAPI *pGetNumberOfConsoleFonts)(void); + DWORD num_fonts; + + hmod = GetModuleHandleA("kernel32.dll"); + pSetConsoleFont = (void *)GetProcAddress(hmod, "SetConsoleFont"); + if (!pSetConsoleFont) + { + win_skip("SetConsoleFont is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pSetConsoleFont(NULL, 0); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pSetConsoleFont(GetStdHandle(STD_INPUT_HANDLE), 0); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); + if (!pGetNumberOfConsoleFonts) + { + win_skip("GetNumberOfConsoleFonts is not available\n"); + return; + } + + num_fonts = pGetNumberOfConsoleFonts(); + + SetLastError(0xdeadbeef); + ret = pSetConsoleFont(std_output, num_fonts); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); +} + START_TEST(console) { static const char font_name[] = "Lucida Console"; @@ -2925,4 +3084,6 @@ test_GetCurrentConsoleFont(hConOut); test_GetConsoleFontSize(hConOut); test_GetLargestConsoleWindowSize(hConOut); -} + test_GetConsoleFontInfo(hConOut); + test_SetConsoleFont(hConOut); +} Modified: trunk/rostests/winetests/kernel32/directory.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/direct…
============================================================================== --- trunk/rostests/winetests/kernel32/directory.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/directory.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -157,6 +157,7 @@ static void test_CreateDirectoryA(void) { char tmpdir[MAX_PATH]; + WCHAR curdir[MAX_PATH]; BOOL ret; ret = CreateDirectoryA(NULL, NULL); @@ -172,6 +173,7 @@ ret = GetSystemDirectoryA(tmpdir, MAX_PATH); ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n"); + GetCurrentDirectoryW(MAX_PATH, curdir); ret = SetCurrentDirectoryA(tmpdir); ok(ret == TRUE, "could not chdir to the System directory\n"); @@ -329,6 +331,7 @@ ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + SetCurrentDirectoryW(curdir); } static void test_CreateDirectoryW(void) @@ -341,6 +344,7 @@ static const WCHAR slashW[] = {'/',0}; static const WCHAR dotdotW[] = {'.','.',0}; static const WCHAR questionW[] = {'?',0}; + WCHAR curdir[MAX_PATH]; ret = CreateDirectoryW(NULL, NULL); if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) @@ -358,6 +362,7 @@ ret = GetSystemDirectoryW(tmpdir, MAX_PATH); ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n"); + GetCurrentDirectoryW(MAX_PATH, curdir); ret = SetCurrentDirectoryW(tmpdir); ok(ret == TRUE, "could not chdir to the System directory ret %u err %u\n", ret, GetLastError()); @@ -413,6 +418,8 @@ ret, GetLastError()); ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE, "RemoveDirectoryW should have failed\n"); + + SetCurrentDirectoryW(curdir); } static void test_RemoveDirectoryA(void) Modified: trunk/rostests/winetests/kernel32/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/file.c…
============================================================================== --- trunk/rostests/winetests/kernel32/file.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/file.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -1214,6 +1214,7 @@ {NULL, 0, -1, 0, FALSE} }; BY_HANDLE_FILE_INFORMATION Finfo; + WCHAR curdir[MAX_PATH]; ret = GetTempPathA(MAX_PATH, temp_path); ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); @@ -1278,6 +1279,7 @@ ret = CreateDirectoryA(dirname, NULL); ok( ret, "Createdirectory failed, gle=%d\n", GetLastError() ); /* set current drive & directory to known location */ + GetCurrentDirectoryW( MAX_PATH, curdir); SetCurrentDirectoryA( temp_path ); i = 0; while (p[i].file) @@ -1332,7 +1334,7 @@ } ret = RemoveDirectoryA(dirname); ok(ret, "RemoveDirectoryA: error %d\n", GetLastError()); - + SetCurrentDirectoryW(curdir); /* test opening directory as a directory */ hFile = CreateFileA( temp_path, GENERIC_READ, @@ -3450,6 +3452,11 @@ "wrong error %u\n", GetLastError() ); ok( r == FALSE, "should return false\n"); + r = GetOverlappedResult( 0, &ov, &result, TRUE ); + ok( r == TRUE, "should return TRUE\n" ); + ok( result == 0xabcd, "wrong result %u\n", result ); + ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", ov.Internal ); + ResetEvent( ov.hEvent ); SetLastError( 0xb00 ); @@ -3845,17 +3852,13 @@ if (i == 0 || i == 5) { /* FIXME: remove once Wine is fixed */ -if (i == 5) todo_wine - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); -else +todo_wine_if (i == 5) ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); } else { /* FIXME: remove once Wine is fixed */ -if (i == 1) todo_wine - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); -else +todo_wine_if (i == 1) ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); } @@ -3867,9 +3870,7 @@ else { /* FIXME: remove once Wine is fixed */ -if (i == 1) todo_wine - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); -else +todo_wine_if (i == 1) ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); } } @@ -4543,9 +4544,28 @@ strcpy(dos_path, dos_prefix); strcat(dos_path, long_path); + count = pGetFinalPathNameByHandleA(INVALID_HANDLE_VALUE, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == 0, "Expected length 0, got %u\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + file = CreateFileA(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); ok(file != INVALID_HANDLE_VALUE, "CreateFileA error %u\n", GetLastError()); + + if (0) { + /* Windows crashes on NULL path */ + count = pGetFinalPathNameByHandleA(file, NULL, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == 0, "Expected length 0, got %u\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + } + + /* Test 0-length path */ + count = pGetFinalPathNameByHandleA(file, result_path, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == strlen(dos_path), "Expected length %u, got %u\n", lstrlenA(dos_path), count); + + /* Test 0 and NULL path */ + count = pGetFinalPathNameByHandleA(file, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == strlen(dos_path), "Expected length %u, got %u\n", lstrlenA(dos_path), count); /* Test VOLUME_NAME_DOS with sufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); @@ -4608,6 +4628,10 @@ ok(count == 0, "Expected length 0, got %u\n", count); ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + count = pGetFinalPathNameByHandleW(INVALID_HANDLE_VALUE, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == 0, "Expected length 0, got %u\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + count = GetTempPathW(MAX_PATH, temp_path); ok(count, "Failed to get temp path, error %u\n", GetLastError()); ret = GetTempFileNameW(temp_path, prefix, 0, test_path); @@ -4620,6 +4644,23 @@ file = CreateFileW(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); ok(file != INVALID_HANDLE_VALUE, "CreateFileW error %u\n", GetLastError()); + + if (0) { + /* Windows crashes on NULL path */ + count = pGetFinalPathNameByHandleW(file, NULL, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == 0, "Expected length 0, got %u\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + } + + /* Test 0-length path */ + count = pGetFinalPathNameByHandleW(file, result_path, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == lstrlenW(dos_path) + 1 || + broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); + + /* Test 0 and NULL path */ + count = pGetFinalPathNameByHandleW(file, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + ok(count == lstrlenW(dos_path) + 1 || + broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); /* Test VOLUME_NAME_DOS with sufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); Modified: trunk/rostests/winetests/kernel32/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/loader…
============================================================================== --- trunk/rostests/winetests/kernel32/loader.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/loader.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -2750,6 +2750,24 @@ DeleteFileA(dll_name); } +static void test_InMemoryOrderModuleList(void) +{ + LIST_ENTRY *entry1, *mark1 = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; + LIST_ENTRY *entry2, *mark2 = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; + LDR_MODULE *module1, *module2; + + for (entry1 = mark1->Flink, entry2 = mark2->Flink; + entry1 != mark1 && entry2 != mark2; + entry1 = entry1->Flink, entry2 = entry2->Flink) + { + module1 = CONTAINING_RECORD(entry1, LDR_MODULE, InLoadOrderModuleList); + module2 = CONTAINING_RECORD(entry2, LDR_MODULE, InMemoryOrderModuleList); + ok(module1 == module2, "expected module1 == module2, got %p and %p\n", module1, module2); + } + ok(entry1 == mark1, "expected entry1 == mark1, got %p and %p\n", entry1, mark1); + ok(entry2 == mark2, "expected entry2 == mark2, got %p and %p\n", entry2, mark2); +} + START_TEST(loader) { int argc; @@ -2804,4 +2822,5 @@ test_section_access(); test_import_resolution(); test_ExitProcess(); + test_InMemoryOrderModuleList(); } Modified: trunk/rostests/winetests/kernel32/locale.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/locale…
============================================================================== --- trunk/rostests/winetests/kernel32/locale.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/locale.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -74,7 +74,6 @@ } /* Some functions are only in later versions of kernel32.dll */ -static HMODULE hKernel32; static WORD enumCount; static INT (WINAPI *pGetTimeFormatEx)(LPCWSTR, DWORD, const SYSTEMTIME *, LPCWSTR, LPWSTR, INT); @@ -101,12 +100,14 @@ static INT (WINAPI *pGetGeoInfoW)(GEOID, GEOTYPE, LPWSTR, INT, LANGID); static BOOL (WINAPI *pEnumSystemGeoID)(GEOCLASS, GEOID, GEO_ENUMPROC); static BOOL (WINAPI *pGetSystemPreferredUILanguages)(DWORD, ULONG*, WCHAR*, ULONG*); +static BOOL (WINAPI *pGetThreadPreferredUILanguages)(DWORD, ULONG*, WCHAR*, ULONG*); +static WCHAR (WINAPI *pRtlUpcaseUnicodeChar)(WCHAR); static void InitFunctionPointers(void) { - hKernel32 = GetModuleHandleA("kernel32"); - -#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) + HMODULE mod = GetModuleHandleA("kernel32"); + +#define X(f) p##f = (void*)GetProcAddress(mod, #f) X(GetTimeFormatEx); X(GetDateFormatEx); X(EnumSystemLanguageGroupsA); @@ -130,6 +131,10 @@ X(GetGeoInfoW); X(EnumSystemGeoID); X(GetSystemPreferredUILanguages); + X(GetThreadPreferredUILanguages); + + mod = GetModuleHandleA("ntdll"); + X(RtlUpcaseUnicodeChar); #undef X } @@ -2458,7 +2463,7 @@ SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(fooW, 0); ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected lcid == 0, got got %08x, error %d\n", lcid, GetLastError()); + "Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError()); /* english neutral name */ lcid = pLocaleNameToLCID(enW, 0); @@ -3767,6 +3772,18 @@ GetStringTypeW(CT_CTYPE1, ch, 2, types); ok(types[0] == (C1_DEFINED|C1_SPACE), "got %x\n", types[0]); ok(types[1] == (C1_DEFINED|C1_SPACE), "got %x\n", types[1]); + + /* check Arabic range for kashida flag */ + for (ch[0] = 0x600; ch[0] <= 0x6ff; ch[0] += 1) + { + types[0] = 0; + ret = GetStringTypeW(CT_CTYPE3, ch, 1, types); + ok(ret, "%#x: failed %d\n", ch[0], ret); + if (ch[0] == 0x640) /* ARABIC TATWEEL (Kashida) */ + ok(types[0] & C3_KASHIDA, "%#x: type %#x\n", ch[0], types[0]); + else + ok(!(types[0] & C3_KASHIDA), "%#x: type %#x\n", ch[0], types[0]); + } } static void test_IdnToNameprepUnicode(void) @@ -4180,6 +4197,8 @@ ok(!ret, "IsValidLocaleName should have failed\n"); ret = pIsValidLocaleName(LOCALE_NAME_INVARIANT); ok(ret, "IsValidLocaleName failed\n"); + ret = pIsValidLocaleName(NULL); + ok(!ret, "IsValidLocaleName should have failed\n"); } static void test_CompareStringOrdinal(void) @@ -4196,6 +4215,7 @@ WCHAR coop2[] = { 'c','o','o','p',0 }; WCHAR nonascii1[] = { 0x0102,0 }; WCHAR nonascii2[] = { 0x0201,0 }; + WCHAR ch1, ch2; if (!pCompareStringOrdinal) { @@ -4252,6 +4272,21 @@ ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, CSTR_LESS_THAN); ret = pCompareStringOrdinal(nonascii1, -1, nonascii2, -1, TRUE); ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, CSTR_LESS_THAN); + + for (ch1 = 0; ch1 < 512; ch1++) + { + for (ch2 = 0; ch2 < 1024; ch2++) + { + int diff = ch1 - ch2; + ret = pCompareStringOrdinal( &ch1, 1, &ch2, 1, FALSE ); + ok( ret == (diff > 0 ? CSTR_GREATER_THAN : diff < 0 ? CSTR_LESS_THAN : CSTR_EQUAL), + "wrong result %d %04x %04x\n", ret, ch1, ch2 ); + diff = pRtlUpcaseUnicodeChar( ch1 ) - pRtlUpcaseUnicodeChar( ch2 ); + ret = pCompareStringOrdinal( &ch1, 1, &ch2, 1, TRUE ); + ok( ret == (diff > 0 ? CSTR_GREATER_THAN : diff < 0 ? CSTR_LESS_THAN : CSTR_EQUAL), + "wrong result %d %04x %04x\n", ret, ch1, ch2 ); + } + } } static void test_GetGeoInfo(void) @@ -4685,7 +4720,7 @@ size_buffer = max(size_id, size_name); if(!size_buffer) { - skip("No vaild buffer size\n"); + skip("No valid buffer size\n"); return; } @@ -4771,6 +4806,34 @@ ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + + HeapFree(GetProcessHeap(), 0, buffer); +} + +static void test_GetThreadPreferredUILanguages(void) +{ + BOOL ret; + ULONG count, size; + WCHAR *buf; + + if (!pGetThreadPreferredUILanguages) + { + win_skip("GetThreadPreferredUILanguages is not available.\n"); + return; + } + + size = count = 0; + ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &count, NULL, &size); + ok(ret, "got %u\n", GetLastError()); + ok(count, "expected count > 0\n"); + ok(size, "expected size > 0\n"); + + count = 0; + buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size * sizeof(WCHAR)); + ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &count, buf, &size); + ok(ret, "got %u\n", GetLastError()); + ok(count, "expected count > 0\n"); + HeapFree(GetProcessHeap(), 0, buf); } START_TEST(locale) @@ -4816,5 +4879,6 @@ test_EnumSystemGeoID(); test_invariant(); test_GetSystemPreferredUILanguages(); + test_GetThreadPreferredUILanguages(); test_sorting(); } Modified: trunk/rostests/winetests/kernel32/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/path.c…
============================================================================== --- trunk/rostests/winetests/kernel32/path.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/path.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -1116,10 +1116,9 @@ { char save_TMP[MAX_PATH]; char windir[MAX_PATH]; - char origdir[MAX_PATH]; char buf[MAX_PATH]; - - GetCurrentDirectoryA(sizeof(origdir), origdir); + WCHAR curdir[MAX_PATH]; + if (!GetEnvironmentVariableA("TMP", save_TMP, sizeof(save_TMP))) save_TMP[0] = 0; /* test default configuration */ @@ -1151,6 +1150,7 @@ test_GetTempPathA(windir); test_GetTempPathW(windir); + GetCurrentDirectoryW(MAX_PATH, curdir); /* TMP=C: i.e. use current working directory of the specified drive */ GetWindowsDirectoryA(windir, sizeof(windir)); SetCurrentDirectoryA(windir); @@ -1164,13 +1164,13 @@ test_GetTempPathW(windir); SetEnvironmentVariableA("TMP", save_TMP); - SetCurrentDirectoryA(origdir); + SetCurrentDirectoryW(curdir); } static void test_GetLongPathNameA(void) { DWORD length, explength, hostsize; - char tempfile[MAX_PATH]; + char tempfile[MAX_PATH], *name; char longpath[MAX_PATH]; char unc_prefix[MAX_PATH]; char unc_short[MAX_PATH], unc_long[MAX_PATH]; @@ -1181,7 +1181,15 @@ return; GetTempPathA(MAX_PATH, tempfile); - lstrcatA(tempfile, "longfilename.longext"); + name = tempfile + strlen(tempfile); + + strcpy(name, "*"); + SetLastError(0xdeadbeef); + length = pGetLongPathNameA(tempfile, temppath, MAX_PATH); + ok(!length, "GetLongPathNameA should fail\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %d\n", GetLastError()); + + strcpy(name, "longfilename.longext"); file = CreateFileA(tempfile, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); CloseHandle(file); @@ -1385,6 +1393,7 @@ static const WCHAR name[] = { 't', 'e', 's', 't', 0 }; static const WCHAR backSlash[] = { '\\', 0 }; static const WCHAR a_bcdeW[] = {'a','.','b','c','d','e',0}; + static const WCHAR wildW[] = { '*',0 }; WCHAR path[MAX_PATH], tmppath[MAX_PATH], *ptr; WCHAR short_path[MAX_PATH]; DWORD length; @@ -1447,6 +1456,13 @@ length = GetShortPathNameW( path, short_path, sizeof(short_path)/sizeof(*short_path) ); ok( length, "GetShortPathNameW failed: %u.\n", GetLastError() ); + lstrcpyW(ptr, wildW); + SetLastError(0xdeadbeef); + length = GetShortPathNameW( path, short_path, sizeof(short_path)/sizeof(*short_path) ); + ok(!length, "GetShortPathNameW should fail\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %d\n", GetLastError()); + + lstrcpyW(ptr, a_bcdeW); ret = DeleteFileW( path ); ok( ret, "Cannot delete file.\n" ); *ptr = 0; @@ -2142,9 +2158,11 @@ char path[MAX_PATH], buf[MAX_PATH]; HANDLE file; int ret; + WCHAR curdir[MAX_PATH]; if (!pGetLongPathNameA) return; + GetCurrentDirectoryW(MAX_PATH, curdir); GetTempPathA(MAX_PATH, path); ret = SetCurrentDirectoryA(path); ok(ret, "SetCurrentDirectory error %d\n", GetLastError()); @@ -2202,6 +2220,7 @@ DeleteFileA("foo\\file"); RemoveDirectoryA("foo"); RemoveDirectoryA("bar"); + SetCurrentDirectoryW(curdir); } static void test_CheckNameLegalDOS8Dot3(void) Modified: trunk/rostests/winetests/kernel32/pipe.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/pipe.c…
============================================================================== --- trunk/rostests/winetests/kernel32/pipe.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/pipe.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -2571,6 +2571,64 @@ CloseHandle(thread); } +static void test_overlapped_error(void) +{ + HANDLE pipe, file, event; + DWORD err, numbytes; + OVERLAPPED overlapped; + BOOL ret; + + event = CreateEventA(NULL, TRUE, FALSE, NULL); + ok(event != NULL, "CreateEventA failed with %u\n", GetLastError()); + + pipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, + 1, 1024, 1024, NMPWAIT_WAIT_FOREVER, NULL); + ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + + memset(&overlapped, 0, sizeof(overlapped)); + overlapped.hEvent = event; + ret = ConnectNamedPipe(pipe, &overlapped); + err = GetLastError(); + ok(ret == FALSE, "ConnectNamedPipe succeeded\n"); + ok(err == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", err); + + file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, + OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + + numbytes = 0xdeadbeef; + ret = GetOverlappedResult(pipe, &overlapped, &numbytes, TRUE); + ok(ret == TRUE, "GetOverlappedResult failed\n"); + ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08lx\n", overlapped.Internal); + + CloseHandle(file); + CloseHandle(pipe); + + pipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, + 1, 1024, 1024, NMPWAIT_WAIT_FOREVER, NULL); + ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + + file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, + OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + + memset(&overlapped, 0, sizeof(overlapped)); + overlapped.hEvent = event; + ret = ConnectNamedPipe(pipe, &overlapped); + err = GetLastError(); + ok(ret == FALSE, "ConnectNamedPipe succeeded\n"); + ok(err == ERROR_PIPE_CONNECTED, "expected ERROR_PIPE_CONNECTED, got %u\n", err); + ok(overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", overlapped.Internal); + + CloseHandle(file); + CloseHandle(pipe); + + CloseHandle(event); +} + static void test_nowait(int pipemode) { HANDLE hnp; @@ -3400,6 +3458,7 @@ test_CloseHandle(); test_impersonation(); test_overlapped(); + test_overlapped_error(); test_nowait(PIPE_TYPE_BYTE); test_nowait(PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE); test_NamedPipeHandleState(); Modified: trunk/rostests/winetests/kernel32/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/proces…
============================================================================== --- trunk/rostests/winetests/kernel32/process.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/process.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -88,6 +88,7 @@ static BOOL (WINAPI *pThread32First)(HANDLE, THREADENTRY32*); static BOOL (WINAPI *pThread32Next)(HANDLE, THREADENTRY32*); static BOOL (WINAPI *pGetLogicalProcessorInformationEx)(LOGICAL_PROCESSOR_RELATIONSHIP,SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*,DWORD*); +static SIZE_T (WINAPI *pGetLargePageMinimum)(void); /* ############################### */ static char base[MAX_PATH]; @@ -252,6 +253,7 @@ pThread32First = (void *)GetProcAddress(hkernel32, "Thread32First"); pThread32Next = (void *)GetProcAddress(hkernel32, "Thread32Next"); pGetLogicalProcessorInformationEx = (void *)GetProcAddress(hkernel32, "GetLogicalProcessorInformationEx"); + pGetLargePageMinimum = (void *)GetProcAddress(hkernel32, "GetLargePageMinimum"); return TRUE; } @@ -2991,7 +2993,7 @@ sizeof(buf) /* ProcessHandleTracing */, sizeof(ULONG) /* ProcessIoPriority */, sizeof(ULONG) /* ProcessExecuteFlags */, -#if 0 /* FIXME: Add remaning classes */ +#if 0 /* FIXME: Add remaining classes */ ProcessResourceManagement, sizeof(ULONG) /* ProcessCookie */, sizeof(SECTION_IMAGE_INFORMATION) /* ProcessImageInformation */, @@ -3138,6 +3140,19 @@ HeapFree(GetProcessHeap(), 0, info); } +static void test_largepages(void) +{ + SIZE_T size; + + if (!pGetLargePageMinimum) { + skip("No GetLargePageMinimum support.\n"); + return; + } + size = pGetLargePageMinimum(); + + ok((size == 0) || (size == 2*1024*1024) || (size == 4*1024*1024), "GetLargePageMinimum reports %ld size\n", size); +} + START_TEST(process) { HANDLE job; @@ -3210,6 +3225,7 @@ test_GetNumaProcessorNode(); test_session_info(); test_GetLogicalProcessorInformationEx(); + test_largepages(); /* things that can be tested: * lookup: check the way program to be executed is searched Modified: trunk/rostests/winetests/kernel32/sync.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/sync.c…
============================================================================== --- trunk/rostests/winetests/kernel32/sync.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/sync.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -1740,9 +1740,9 @@ /* Sequence of wake/sleep to check boundary conditions: * 0: init - * 1: producer emits a WakeConditionVaribale without consumer waiting. + * 1: producer emits a WakeConditionVariable without consumer waiting. * 2: consumer sleeps without a wake expecting timeout - * 3: producer emits a WakeAllConditionVaribale without consumer waiting. + * 3: producer emits a WakeAllConditionVariable without consumer waiting. * 4: consumer sleeps without a wake expecting timeout * 5: a wake is handed to a SleepConditionVariableCS * 6: a wakeall is handed to a SleepConditionVariableCS Modified: trunk/rostests/winetests/kernel32/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/virtua…
============================================================================== --- trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] Tue Jul 12 21:10:24 2016 @@ -43,7 +43,6 @@ static NTSTATUS (WINAPI *pNtAreMappedFilesTheSame)(PVOID,PVOID); static NTSTATUS (WINAPI *pNtMapViewOfSection)(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, const LARGE_INTEGER *, SIZE_T *, ULONG, ULONG, ULONG); static DWORD (WINAPI *pNtUnmapViewOfSection)(HANDLE, PVOID); -static struct _TEB * (WINAPI *pNtCurrentTeb)(void); static PVOID (WINAPI *pRtlAddVectoredExceptionHandler)(ULONG, PVECTORED_EXCEPTION_HANDLER); static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID); static BOOL (WINAPI *pGetProcessDEPPolicy)(HANDLE, LPDWORD, PBOOL); @@ -454,7 +453,7 @@ SetLastError(0xdeadbeef); file = CreateFileA( testfile, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); - SetFilePointer( file, 4096, NULL, FILE_BEGIN ); + SetFilePointer( file, 12288, NULL, FILE_BEGIN ); SetEndOfFile( file ); /* read/write mapping */ @@ -1013,6 +1012,31 @@ ok(info.State == MEM_FREE, "%#x != MEM_FREE\n", info.State); ok(info.Type == 0, "%#x != 0\n", info.Type); + mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 12288, NULL ); + ok( mapping != 0, "CreateFileMappingA failed with error %u\n", GetLastError() ); + + ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); + ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + + ret = UnmapViewOfFile( (char *)ptr + 100 ); + ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + if (!ret) UnmapViewOfFile( ptr ); + + ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); + ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + + ret = UnmapViewOfFile( (char *)ptr + 4096 ); + ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + if (!ret) UnmapViewOfFile( ptr ); + + ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); + ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + + ret = UnmapViewOfFile( (char *)ptr + 4096 + 100 ); + ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + if (!ret) UnmapViewOfFile( ptr ); + + CloseHandle(mapping); CloseHandle(file); DeleteFileA(testfile); } @@ -1824,263 +1848,14 @@ VirtualFree( base, 0, MEM_RELEASE ); } -#ifdef __i386__ - -static DWORD num_guard_page_calls; - -static DWORD guard_page_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, - CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) -{ - trace( "exception: %08x flags:%x addr:%p\n", - rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress ); - - ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); - ok( rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, "ExceptionCode is %08x instead of %08x\n", - rec->ExceptionCode, STATUS_GUARD_PAGE_VIOLATION ); - - num_guard_page_calls++; - *(int *)rec->ExceptionInformation[1] += 0x100; - - return ExceptionContinueExecution; -} - -static void test_guard_page(void) -{ - EXCEPTION_REGISTRATION_RECORD frame; - MEMORY_BASIC_INFORMATION info; - DWORD ret, size, old_prot; - int *value, old_value; - void *results[64]; - ULONG_PTR count; - ULONG pagesize; - BOOL success; - char *base; - - if (!pNtCurrentTeb) - { - win_skip( "NtCurrentTeb not supported\n" ); - return; - } - - size = 0x1000; - base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); - value = (int *)base; - - /* verify info structure */ - ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); - ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); - ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); - - /* put some initial value into the memory */ - success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == (PAGE_READWRITE | PAGE_GUARD), "wrong old prot %x\n", old_prot ); - - *value = 1; - *(value + 1) = 2; - - success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); - - /* test behaviour of VirtualLock - first attempt should fail */ - SetLastError( 0xdeadbeef ); - success = VirtualLock( base, size ); - ok( !success, "VirtualLock unexpectedly succeeded\n" ); - todo_wine - ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); - - success = VirtualLock( base, size ); - todo_wine - ok( success, "VirtualLock failed %u\n", GetLastError() ); - if (success) - { - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); - success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); - } - - /* check info structure again, PAGE_GUARD should be removed now */ - ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); - ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); - ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - todo_wine - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); - - success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - todo_wine - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); - - /* test directly accessing the memory - we need to setup an exception handler first */ - frame.Handler = guard_page_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = 0; - old_value = *value; /* exception handler increments value by 0x100 */ - *value = 2; - ok( old_value == 0x101, "memory block contains wrong value, expected 0x101, got 0x%x\n", old_value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); - - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; - - /* check info structure again, PAGE_GUARD should be removed now */ - ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); - - success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); - - /* test accessing second integer in memory */ - frame.Handler = guard_page_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = 0; - old_value = *(value + 1); - ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); - ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); - - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; - - success = VirtualLock( base, size ); - ok( success, "VirtualLock failed %u\n", GetLastError() ); - if (success) - { - ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); - success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); - } - - VirtualFree( base, 0, MEM_RELEASE ); - - /* combined guard page / write watch tests */ - if (!pGetWriteWatch || !pResetWriteWatch) - { - win_skip( "GetWriteWatch not supported, skipping combined guard page / write watch tests\n" ); - return; - } - - base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE | PAGE_GUARD ); - if (!base && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_NOT_SUPPORTED)) - { - win_skip( "MEM_WRITE_WATCH not supported\n" ); - return; - } - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); - value = (int *)base; - - ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError() ); - ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); - ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); - - count = 64; - ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); - - /* writing to a page should trigger should trigger guard page, even if write watch is set */ - frame.Handler = guard_page_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = 0; - *value = 1; - *(value + 1) = 2; - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); - - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; - - count = 64; - ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); - ok( results[0] == base, "wrong result %p\n", results[0] ); - - success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - - /* write watch is triggered from inside of the guard page handler */ - frame.Handler = guard_page_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = 0; - old_value = *(value + 1); /* doesn't trigger write watch */ - ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); - - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; - - count = 64; - ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); - ok( results[0] == base, "wrong result %p\n", results[0] ); - - success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - - /* test behaviour of VirtualLock - first attempt should fail without triggering write watches */ - SetLastError( 0xdeadbeef ); - success = VirtualLock( base, size ); - ok( !success, "VirtualLock unexpectedly succeeded\n" ); - todo_wine - ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); - - count = 64; - ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); - - success = VirtualLock( base, size ); - todo_wine - ok( success, "VirtualLock failed %u\n", GetLastError() ); - if (success) - { - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); - success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); - } - - count = 64; - results[0] = (void *)0xdeadbeef; - ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - todo_wine - ok( count == 1 || broken(count == 0) /* Windows 8 */, "wrong count %lu\n", count ); - todo_wine - ok( results[0] == base || broken(results[0] == (void *)0xdeadbeef) /* Windows 8 */, "wrong result %p\n", results[0] ); - - VirtualFree( base, 0, MEM_RELEASE ); -} +#if defined(__i386__) || defined(__x86_64__) static DWORD WINAPI stack_commit_func( void *arg ) { volatile char *p = (char *)&p; /* trigger all guard pages, to ensure that the pages are committed */ - while (p >= (char *)pNtCurrentTeb()->DeallocationStack + 3 * 0x1000) + while (p >= (char *)NtCurrentTeb()->DeallocationStack + 4 * 0x1000) { p[0] |= 0; p -= 0x1000; @@ -2092,6 +1867,7 @@ static void test_stack_commit(void) { +#ifdef __i386__ static const char code_call_on_stack[] = { 0x55, /* pushl %ebp */ 0x56, /* pushl %esi */ @@ -2109,17 +1885,24 @@ 0x5e, /* popl %esi */ 0x5d, /* popl %ebp */ 0xc2, 0x0c, 0x00 }; /* ret $12 */ - +#else + static const char code_call_on_stack[] = { + 0x55, /* pushq %rbp */ + 0x48, 0x89, 0xe5, /* movq %rsp,%rbp */ + /* %rcx - func, %rdx - arg, %r8 - stack */ + 0x48, 0x87, 0xca, /* xchgq %rcx,%rdx */ + 0x49, 0x83, 0xe0, 0xf0, /* andq $~15,%r8 */ + 0x49, 0x83, 0xe8, 0x20, /* subq $0x20,%r8 */ + 0x4c, 0x89, 0xc4, /* movq %r8,%rsp */ + 0xff, 0xd2, /* callq *%rdx */ + 0x48, 0x89, 0xec, /* movq %rbp,%rsp */ + 0x5d, /* popq %rbp */ + 0xc3 }; /* ret */ +#endif DWORD (WINAPI *call_on_stack)( DWORD (WINAPI *func)(void *), void *arg, void *stack ); void *old_stack, *old_stack_base, *old_stack_limit; void *new_stack, *new_stack_base; DWORD result; - - if (!pNtCurrentTeb) - { - win_skip( "NtCurrentTeb not supported\n" ); - return; - } call_on_stack = VirtualAlloc( 0, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); ok( call_on_stack != NULL, "VirtualAlloc failed %u\n", GetLastError() ); @@ -2131,26 +1914,273 @@ new_stack_base = (char *)new_stack + 0x400000; VirtualAlloc( (char *)new_stack_base - 0x1000, 0x1000, MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD ); - old_stack = pNtCurrentTeb()->DeallocationStack; - old_stack_base = pNtCurrentTeb()->Tib.StackBase; - old_stack_limit = pNtCurrentTeb()->Tib.StackLimit; - - pNtCurrentTeb()->DeallocationStack = new_stack; - pNtCurrentTeb()->Tib.StackBase = new_stack_base; - pNtCurrentTeb()->Tib.StackLimit = new_stack_base; + old_stack = NtCurrentTeb()->DeallocationStack; + old_stack_base = NtCurrentTeb()->Tib.StackBase; + old_stack_limit = NtCurrentTeb()->Tib.StackLimit; + + NtCurrentTeb()->DeallocationStack = new_stack; + NtCurrentTeb()->Tib.StackBase = new_stack_base; + NtCurrentTeb()->Tib.StackLimit = new_stack_base; result = call_on_stack( stack_commit_func, (void *)0xdeadbeef, new_stack_base ); + + NtCurrentTeb()->DeallocationStack = old_stack; + NtCurrentTeb()->Tib.StackBase = old_stack_base; + NtCurrentTeb()->Tib.StackLimit = old_stack_limit; + ok( result == 42, "expected 42, got %u\n", result ); - - pNtCurrentTeb()->DeallocationStack = old_stack; - pNtCurrentTeb()->Tib.StackBase = old_stack_base; - pNtCurrentTeb()->Tib.StackLimit = old_stack_limit; VirtualFree( new_stack, 0, MEM_RELEASE ); VirtualFree( call_on_stack, 0, MEM_RELEASE ); } -DWORD num_execute_fault_calls; +#endif /* defined(__i386__) || defined(__x86_64__) */ +#ifdef __i386__ + +static LONG num_guard_page_calls; + +static DWORD guard_page_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, + CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) +{ + trace( "exception: %08x flags:%x addr:%p\n", + rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress ); + + ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); + ok( rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, "ExceptionCode is %08x instead of %08x\n", + rec->ExceptionCode, STATUS_GUARD_PAGE_VIOLATION ); + + InterlockedIncrement( &num_guard_page_calls ); + *(int *)rec->ExceptionInformation[1] += 0x100; + + return ExceptionContinueExecution; +} + +static void test_guard_page(void) +{ + EXCEPTION_REGISTRATION_RECORD frame; + MEMORY_BASIC_INFORMATION info; + DWORD ret, size, old_prot; + int *value, old_value; + void *results[64]; + ULONG_PTR count; + ULONG pagesize; + BOOL success; + char *base; + + size = 0x1000; + base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD ); + ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + value = (int *)base; + + /* verify info structure */ + ret = VirtualQuery( base, &info, sizeof(info) ); + ok( ret, "VirtualQuery failed %u\n", GetLastError()); + ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); + ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + + /* put some initial value into the memory */ + success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( old_prot == (PAGE_READWRITE | PAGE_GUARD), "wrong old prot %x\n", old_prot ); + + *value = 1; + *(value + 1) = 2; + + success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + + /* test behaviour of VirtualLock - first attempt should fail */ + SetLastError( 0xdeadbeef ); + success = VirtualLock( base, size ); + ok( !success, "VirtualLock unexpectedly succeeded\n" ); + todo_wine + ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); + + success = VirtualLock( base, size ); + todo_wine + ok( success, "VirtualLock failed %u\n", GetLastError() ); + if (success) + { + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); + success = VirtualUnlock( base, size ); + ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + } + + /* check info structure again, PAGE_GUARD should be removed now */ + ret = VirtualQuery( base, &info, sizeof(info) ); + ok( ret, "VirtualQuery failed %u\n", GetLastError()); + ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); + todo_wine + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + + success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + todo_wine + ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + + /* test directly accessing the memory - we need to setup an exception handler first */ + frame.Handler = guard_page_handler; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &old_value, *value ); /* exception handler increments value by 0x100 */ + *value = 2; + ok( old_value == 0x101, "memory block contains wrong value, expected 0x101, got 0x%x\n", old_value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; + + /* check info structure again, PAGE_GUARD should be removed now */ + ret = VirtualQuery( base, &info, sizeof(info) ); + ok( ret, "VirtualQuery failed %u\n", GetLastError()); + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); + + success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + + /* test accessing second integer in memory */ + frame.Handler = guard_page_handler; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + old_value = *(value + 1); + ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); + ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; + + success = VirtualLock( base, size ); + ok( success, "VirtualLock failed %u\n", GetLastError() ); + if (success) + { + ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); + success = VirtualUnlock( base, size ); + ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + } + + VirtualFree( base, 0, MEM_RELEASE ); + + /* combined guard page / write watch tests */ + if (!pGetWriteWatch || !pResetWriteWatch) + { + win_skip( "GetWriteWatch not supported, skipping combined guard page / write watch tests\n" ); + return; + } + + base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE | PAGE_GUARD ); + if (!base && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_NOT_SUPPORTED)) + { + win_skip( "MEM_WRITE_WATCH not supported\n" ); + return; + } + ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + value = (int *)base; + + ret = VirtualQuery( base, &info, sizeof(info) ); + ok( ret, "VirtualQuery failed %u\n", GetLastError() ); + ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); + ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 0, "wrong count %lu\n", count ); + + /* writing to a page should trigger should trigger guard page, even if write watch is set */ + frame.Handler = guard_page_handler; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + *value = 1; + *(value + 1) = 2; + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; + + count = 64; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 1, "wrong count %lu\n", count ); + ok( results[0] == base, "wrong result %p\n", results[0] ); + + success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + + /* write watch is triggered from inside of the guard page handler */ + frame.Handler = guard_page_handler; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + old_value = *(value + 1); /* doesn't trigger write watch */ + ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; + + count = 64; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 1, "wrong count %lu\n", count ); + ok( results[0] == base, "wrong result %p\n", results[0] ); + + success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + + /* test behaviour of VirtualLock - first attempt should fail without triggering write watches */ + SetLastError( 0xdeadbeef ); + success = VirtualLock( base, size ); + ok( !success, "VirtualLock unexpectedly succeeded\n" ); + todo_wine + ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 0, "wrong count %lu\n", count ); + + success = VirtualLock( base, size ); + todo_wine + ok( success, "VirtualLock failed %u\n", GetLastError() ); + if (success) + { + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); + success = VirtualUnlock( base, size ); + ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + } + + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + todo_wine + ok( count == 1 || broken(count == 0) /* Windows 8 */, "wrong count %lu\n", count ); + todo_wine + ok( results[0] == base || broken(results[0] == (void *)0xdeadbeef) /* Windows 8 */, "wrong result %p\n", results[0] ); + + VirtualFree( base, 0, MEM_RELEASE ); +} + +static LONG num_execute_fault_calls; static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) @@ -2175,7 +2205,7 @@ ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %d instead of %d\n", (DWORD)rec->ExceptionInformation[0], err ); - num_guard_page_calls++; + InterlockedIncrement( &num_guard_page_calls ); } else if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) { @@ -2190,7 +2220,7 @@ ok( success, "VirtualProtect failed %u\n", GetLastError() ); ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); - num_execute_fault_calls++; + InterlockedIncrement( &num_execute_fault_calls ); } return ExceptionContinueExecution; @@ -2211,7 +2241,7 @@ "ExceptionCode is %08x instead of STATUS_ACCESS_VIOLATION\n", rec->ExceptionCode ); if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) - num_execute_fault_calls++; + InterlockedIncrement( &num_execute_fault_calls ); if (rec->ExceptionInformation[0] == EXCEPTION_READ_FAULT) return EXCEPTION_CONTINUE_SEARCH; @@ -2229,13 +2259,14 @@ DWORD ret; frame.Handler = execute_fault_seh_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = num_execute_fault_calls = 0; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &num_execute_fault_calls, 0 ); ret = SendMessageA( hWnd, uMsg, wParam, lParam ); - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; return ret; } @@ -2246,13 +2277,14 @@ DWORD ret; frame.Handler = execute_fault_seh_handler; - frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; - pNtCurrentTeb()->Tib.ExceptionList = &frame; - - num_guard_page_calls = num_execute_fault_calls = 0; + frame.Prev = NtCurrentTeb()->Tib.ExceptionList; + NtCurrentTeb()->Tib.ExceptionList = &frame; + + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &num_execute_fault_calls, 0 ); ret = code( arg ); - pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; + NtCurrentTeb()->Tib.ExceptionList = frame.Prev; return ret; } @@ -2299,12 +2331,6 @@ char *base; HWND hWnd; - if (!pNtCurrentTeb) - { - win_skip( "NtCurrentTeb not supported\n" ); - return; - } - trace( "Running DEP tests with ProcessExecuteFlags = %d\n", dep_flags ); NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, &old_flags, sizeof(old_flags), NULL ); @@ -2608,7 +2634,7 @@ ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] ); - /* Create a new window class and associcated Window (see above) */ + /* Create a new window class and associated Window (see above) */ success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); ok( success, "VirtualProtect failed %u\n", GetLastError() ); @@ -3296,7 +3322,9 @@ SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.Protect == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_after_write); + /* FIXME: remove the condition below once Wine is fixed */ + todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) + ok(info.Protect == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_after_write); } } else @@ -3310,7 +3338,9 @@ SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); - ok(old_prot == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_after_write); + /* FIXME: remove the condition below once Wine is fixed */ + todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) + ok(old_prot == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_after_write); } UnmapViewOfFile(base); @@ -3840,7 +3870,6 @@ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress); todo_wine ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes); -todo_wine ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart); status = pNtQuerySection(mapping, SectionImageInformation, &info, sizeof(info.basic), &ret); @@ -3864,7 +3893,6 @@ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress); todo_wine ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes); -todo_wine ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart); UnmapViewOfFile(p); @@ -3950,16 +3978,13 @@ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress); todo_wine ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes); -todo_wine ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart); CloseHandle(mapping); SetLastError(0xdeadbef); mapping = CreateFileMappingA(file, NULL, PAGE_READONLY|SEC_RESERVE, 0, 0, NULL); -todo_wine ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError()); - if (!mapping) goto skip1; memset(&info, 0x55, sizeof(info)); ret = 0xdeadbeef; @@ -3967,11 +3992,11 @@ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status); ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret); ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress); +todo_wine ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes); ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart); CloseHandle(mapping); -skip1: CloseHandle(file); SetLastError(0xdeadbef); @@ -4076,7 +4101,6 @@ pNtAreMappedFilesTheSame = (void *)GetProcAddress( hntdll, "NtAreMappedFilesTheSame" ); pNtMapViewOfSection = (void *)GetProcAddress( hntdll, "NtMapViewOfSection" ); pNtUnmapViewOfSection = (void *)GetProcAddress( hntdll, "NtUnmapViewOfSection" ); - pNtCurrentTeb = (void *)GetProcAddress( hntdll, "NtCurrentTeb" ); pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlAddVectoredExceptionHandler" ); pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlRemoveVectoredExceptionHandler" ); pNtQuerySection = (void *)GetProcAddress( hntdll, "NtQuerySection" ); @@ -4103,7 +4127,9 @@ test_IsBadWritePtr(); test_IsBadCodePtr(); test_write_watch(); +#if defined(__i386__) || defined(__x86_64__) test_stack_commit(); +#endif #ifdef __i386__ if (!winetest_interactive) {
8 years, 4 months
1
0
0
0
[akhaldi] 71909: [NTDLL_WINETEST] Partial sync with Wine Staging 1.9.14. CORE-11368 holds some remaining tests.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 12 20:40:20 2016 New Revision: 71909 URL:
http://svn.reactos.org/svn/reactos?rev=71909&view=rev
Log: [NTDLL_WINETEST] Partial sync with Wine Staging 1.9.14. CORE-11368 holds some remaining tests. Modified: trunk/rostests/winetests/ntdll/CMakeLists.txt trunk/rostests/winetests/ntdll/error.c trunk/rostests/winetests/ntdll/file.c trunk/rostests/winetests/ntdll/pipe.c trunk/rostests/winetests/ntdll/reg.c trunk/rostests/winetests/ntdll/rtl.c trunk/rostests/winetests/ntdll/rtlstr.c Modified: trunk/rostests/winetests/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/CMakeList…
============================================================================== --- trunk/rostests/winetests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/CMakeLists.txt [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -28,7 +28,7 @@ add_executable(ntdll_winetest ${SOURCE}) set_module_type(ntdll_winetest win32cui) -add_importlibs(ntdll_winetest user32 msvcrt kernel32 ntdll) +add_importlibs(ntdll_winetest user32 ole32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET ntdll_winetest DESTINATION reactos/bin FOR all) if(NOT MSVC) Modified: trunk/rostests/winetests/ntdll/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/error.c?r…
============================================================================== --- trunk/rostests/winetests/ntdll/error.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/error.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -125,8 +125,10 @@ cmp(STATUS_DATATYPE_MISALIGNMENT, ERROR_NOACCESS); cmp(STATUS_ACCESS_VIOLATION, ERROR_NOACCESS); cmp2(STATUS_DATATYPE_MISALIGNMENT_ERROR, ERROR_NOACCESS); + cmp2(STATUS_MULTIPLE_FAULT_VIOLATION, ERROR_MULTIPLE_FAULT_VIOLATION); cmp(STATUS_CTL_FILE_NOT_SUPPORTED, ERROR_NOT_SUPPORTED); cmp(STATUS_PORT_ALREADY_SET, ERROR_INVALID_PARAMETER); + cmp2(STATUS_PORT_NOT_SET, ERROR_PORT_NOT_SET); cmp(STATUS_SECTION_NOT_IMAGE, ERROR_INVALID_PARAMETER); cmp(STATUS_BAD_WORKING_SET_LIMIT, ERROR_INVALID_PARAMETER); cmp(STATUS_WORKING_SET_LIMIT_RANGE, ERROR_INVALID_PARAMETER); @@ -140,6 +142,7 @@ cmp(STATUS_INVALID_CID, ERROR_INVALID_PARAMETER); cmp(STATUS_STACK_OVERFLOW, ERROR_STACK_OVERFLOW); cmp(STATUS_BAD_INITIAL_STACK, ERROR_STACK_OVERFLOW); + cmp4(STATUS_STACK_OVERFLOW_READ, ERROR_STACK_OVERFLOW_READ, ERROR_STACK_OVERFLOW); cmp(STATUS_INVALID_VOLUME_LABEL, ERROR_LABEL_TOO_LONG); cmp(STATUS_SECTION_NOT_EXTENDED, ERROR_OUTOFMEMORY); cmp(STATUS_NOT_MAPPED_DATA, ERROR_INVALID_ADDRESS); @@ -148,29 +151,46 @@ cmp(STATUS_INVALID_INFO_CLASS, ERROR_INVALID_PARAMETER); cmp(STATUS_SUSPEND_COUNT_EXCEEDED, ERROR_SIGNAL_REFUSED); cmp(STATUS_NOTIFY_ENUM_DIR, ERROR_NOTIFY_ENUM_DIR); + cmp2(STATUS_BAD_CURRENT_DIRECTORY, ERROR_BAD_CURRENT_DIRECTORY); cmp(STATUS_REGISTRY_RECOVERED, ERROR_REGISTRY_RECOVERED); + cmp2(STATUS_REGISTRY_HIVE_RECOVERED, ERROR_REGISTRY_HIVE_RECOVERED); cmp(STATUS_REGISTRY_IO_FAILED, ERROR_REGISTRY_IO_FAILED); cmp(STATUS_NOT_REGISTRY_FILE, ERROR_NOT_REGISTRY_FILE); + cmp2(STATUS_CANNOT_LOAD_REGISTRY_FILE, ERROR_CANNOT_LOAD_REGISTRY_FILE); + cmp2(STATUS_SYSTEM_HIVE_TOO_LARGE, ERROR_SYSTEM_HIVE_TOO_LARGE); cmp(STATUS_KEY_DELETED, ERROR_KEY_DELETED); cmp(STATUS_NO_LOG_SPACE, ERROR_NO_LOG_SPACE); cmp(STATUS_KEY_HAS_CHILDREN, ERROR_KEY_HAS_CHILDREN); cmp(STATUS_CHILD_MUST_BE_VOLATILE, ERROR_CHILD_MUST_BE_VOLATILE); cmp(STATUS_REGISTRY_CORRUPT, ERROR_BADDB); + cmp2(STATUS_REGISTRY_QUOTA_LIMIT, ERROR_REGISTRY_QUOTA_LIMIT); cmp(STATUS_DLL_NOT_FOUND, ERROR_MOD_NOT_FOUND); cmp2(STATUS_OPEN_FAILED, ERROR_NET_OPEN_FAILED); cmp2(STATUS_IO_PRIVILEGE_FAILED, ERROR_IO_PRIVILEGE_FAILED); cmp(STATUS_DLL_INIT_FAILED, ERROR_DLL_INIT_FAILED); + cmp2(STATUS_DLL_INIT_FAILED_LOGOFF, ERROR_DLL_INIT_FAILED_LOGOFF); cmp2(STATUS_INVALID_IMPORT_OF_NON_DLL, ERROR_INVALID_IMPORT_OF_NON_DLL); cmp(STATUS_ORDINAL_NOT_FOUND, ERROR_INVALID_ORDINAL); cmp(STATUS_DRIVER_ORDINAL_NOT_FOUND, ERROR_INVALID_ORDINAL); cmp2(STATUS_DRIVER_UNABLE_TO_LOAD, ERROR_BAD_DRIVER); cmp(STATUS_ENTRYPOINT_NOT_FOUND, ERROR_PROC_NOT_FOUND); cmp(STATUS_DRIVER_ENTRYPOINT_NOT_FOUND, ERROR_PROC_NOT_FOUND); + cmp2(STATUS_BAD_DLL_ENTRYPOINT, ERROR_BAD_DLL_ENTRYPOINT); + cmp2(STATUS_BAD_SERVICE_ENTRYPOINT, ERROR_BAD_SERVICE_ENTRYPOINT); + cmp2(STATUS_FAILED_DRIVER_ENTRY, ERROR_FAILED_DRIVER_ENTRY); + cmp2(STATUS_DLL_MIGHT_BE_INSECURE, ERROR_DLL_MIGHT_BE_INSECURE); + cmp2(STATUS_DLL_MIGHT_BE_INCOMPATIBLE, ERROR_DLL_MIGHT_BE_INCOMPATIBLE); + cmp2(STATUS_ILLEGAL_DLL_RELOCATION, ERROR_ILLEGAL_DLL_RELOCATION); + cmp2(STATUS_NOT_SAFE_MODE_DRIVER, ERROR_NOT_SAFE_MODE_DRIVER); + cmp2(STATUS_DRIVER_DATABASE_ERROR, ERROR_DRIVER_DATABASE_ERROR); cmp(STATUS_PENDING, ERROR_IO_PENDING); cmp(STATUS_MORE_ENTRIES, ERROR_MORE_DATA); cmp(STATUS_INTEGER_OVERFLOW, ERROR_ARITHMETIC_OVERFLOW); cmp(STATUS_BUFFER_OVERFLOW, ERROR_MORE_DATA); + cmp2(STATUS_MARSHALL_OVERFLOW, ERROR_MARSHALL_OVERFLOW); cmp(STATUS_NO_MORE_FILES, ERROR_NO_MORE_FILES); + cmp2(STATUS_REDIRECTOR_HAS_OPEN_HANDLES, ERROR_REDIRECTOR_HAS_OPEN_HANDLES); + cmp2(STATUS_SERVER_HAS_OPEN_HANDLES, ERROR_SERVER_HAS_OPEN_HANDLES); cmp2(STATUS_HANDLES_CLOSED, ERROR_HANDLES_CLOSED); cmp(STATUS_NO_INHERITANCE, ERROR_NO_INHERITANCE); cmp(STATUS_NO_MORE_EAS, ERROR_NO_MORE_ITEMS); @@ -183,8 +203,19 @@ cmp(STATUS_ILLEGAL_FUNCTION, ERROR_INVALID_FUNCTION); cmp(STATUS_IN_PAGE_ERROR, ERROR_SWAPERROR); cmp(STATUS_PAGEFILE_QUOTA, ERROR_PAGEFILE_QUOTA); + cmp2(STATUS_PAGEFILE_QUOTA_EXCEEDED, ERROR_PAGEFILE_QUOTA_EXCEEDED); + cmp2(STATUS_PAGE_FAULT_TRANSITION, ERROR_PAGE_FAULT_TRANSITION); + cmp2(STATUS_PAGE_FAULT_DEMAND_ZERO, ERROR_PAGE_FAULT_DEMAND_ZERO); + cmp2(STATUS_PAGE_FAULT_COPY_ON_WRITE, ERROR_PAGE_FAULT_COPY_ON_WRITE); + cmp2(STATUS_PAGE_FAULT_GUARD_PAGE, ERROR_PAGE_FAULT_GUARD_PAGE); + cmp2(STATUS_PAGE_FAULT_PAGING_FILE, ERROR_PAGE_FAULT_PAGING_FILE); + cmp2(STATUS_CACHE_PAGE_LOCKED, ERROR_CACHE_PAGE_LOCKED); + cmp2(STATUS_PAGEFILE_CREATE_FAILED, ERROR_PAGEFILE_CREATE_FAILED); + cmp2(STATUS_NO_PAGEFILE, ERROR_NO_PAGEFILE); cmp(STATUS_COMMITMENT_LIMIT, ERROR_COMMITMENT_LIMIT); + cmp2(STATUS_COMMITMENT_MINIMUM, ERROR_COMMITMENT_MINIMUM); cmp(STATUS_SECTION_TOO_BIG, ERROR_NOT_ENOUGH_MEMORY); + cmp2(STATUS_SEGMENT_NOTIFICATION, ERROR_SEGMENT_NOTIFICATION); cmp(RPC_NT_SS_IN_NULL_CONTEXT, ERROR_INVALID_HANDLE); cmp(RPC_NT_INVALID_BINDING, ERROR_INVALID_HANDLE); cmp(STATUS_INVALID_HANDLE, ERROR_INVALID_HANDLE); @@ -195,6 +226,7 @@ cmp(STATUS_NOT_COMMITTED, ERROR_INVALID_ADDRESS); cmp(STATUS_PARTIAL_COPY, ERROR_PARTIAL_COPY); cmp3(STATUS_LPC_REPLY_LOST, ERROR_CONNECTION_ABORTED, ERROR_INTERNAL_ERROR); + cmp2(STATUS_INVALID_VARIANT, ERROR_INVALID_VARIANT); cmp(STATUS_INVALID_PARAMETER, ERROR_INVALID_PARAMETER); cmp(STATUS_INVALID_PARAMETER_1, ERROR_INVALID_PARAMETER); cmp(STATUS_INVALID_PARAMETER_2, ERROR_INVALID_PARAMETER); @@ -219,19 +251,26 @@ cmp(STATUS_NO_SUCH_FILE, ERROR_FILE_NOT_FOUND); cmp(STATUS_INVALID_DEVICE_REQUEST, ERROR_INVALID_FUNCTION); cmp2(STATUS_VOLUME_NOT_UPGRADED, ERROR_INVALID_FUNCTION); + cmp2(STATUS_CONVERT_TO_LARGE, ERROR_CONVERT_TO_LARGE); cmp(STATUS_END_OF_FILE, ERROR_HANDLE_EOF); cmp(STATUS_FILE_FORCED_CLOSED, ERROR_HANDLE_EOF); cmp(STATUS_WRONG_VOLUME, ERROR_WRONG_DISK); cmp(STATUS_NO_MEDIA, ERROR_NO_MEDIA_IN_DRIVE); cmp(STATUS_NO_MEDIA_IN_DEVICE, ERROR_NOT_READY); cmp2(STATUS_VOLUME_DISMOUNTED, ERROR_NOT_READY); + cmp2(STATUS_VOLUME_MOUNTED, ERROR_VOLUME_MOUNTED); + cmp2(STATUS_MOUNT_POINT_NOT_RESOLVED, ERROR_MOUNT_POINT_NOT_RESOLVED); cmp(STATUS_NONEXISTENT_SECTOR, ERROR_SECTOR_NOT_FOUND); cmp(STATUS_WORKING_SET_QUOTA, ERROR_WORKING_SET_QUOTA); cmp(STATUS_NO_MEMORY, ERROR_NOT_ENOUGH_MEMORY); cmp(STATUS_CONFLICTING_ADDRESSES, ERROR_INVALID_ADDRESS); cmp(STATUS_INVALID_SYSTEM_SERVICE, ERROR_INVALID_FUNCTION); + cmp2(STATUS_THREAD_WAS_SUSPENDED, ERROR_THREAD_WAS_SUSPENDED); + cmp2(STATUS_TOO_MANY_THREADS, ERROR_TOO_MANY_THREADS); + cmp2(STATUS_THREAD_NOT_IN_PROCESS, ERROR_THREAD_NOT_IN_PROCESS); cmp(STATUS_THREAD_IS_TERMINATING, ERROR_ACCESS_DENIED); cmp(STATUS_PROCESS_IS_TERMINATING, ERROR_ACCESS_DENIED); + cmp2(STATUS_SYSTEM_PROCESS_TERMINATED, ERROR_SYSTEM_PROCESS_TERMINATED); cmp(STATUS_INVALID_LOCK_SEQUENCE, ERROR_ACCESS_DENIED); cmp(STATUS_INVALID_VIEW_SIZE, ERROR_ACCESS_DENIED); cmp(STATUS_ALREADY_COMMITTED, ERROR_ACCESS_DENIED); @@ -273,12 +312,16 @@ cmp(STATUS_BUFFER_TOO_SMALL, ERROR_INSUFFICIENT_BUFFER); cmp(STATUS_UNABLE_TO_DECOMMIT_VM, ERROR_INVALID_ADDRESS); cmp(STATUS_DISK_CORRUPT_ERROR, ERROR_DISK_CORRUPT); + cmp2(STATUS_FT_READ_RECOVERY_FROM_BACKUP, ERROR_FT_READ_RECOVERY_FROM_BACKUP); + cmp2(STATUS_FT_WRITE_RECOVERY, ERROR_FT_WRITE_RECOVERY); cmp(STATUS_FT_MISSING_MEMBER, ERROR_IO_DEVICE); cmp(STATUS_FT_ORPHANING, ERROR_IO_DEVICE); + cmp2(STATUS_BACKUP_CONTROLLER, ERROR_BACKUP_CONTROLLER); cmp(STATUS_VARIABLE_NOT_FOUND, ERROR_ENVVAR_NOT_FOUND); cmp(STATUS_OBJECT_NAME_INVALID, ERROR_INVALID_NAME); cmp(STATUS_OBJECT_NAME_NOT_FOUND, ERROR_FILE_NOT_FOUND); cmp(STATUS_OBJECT_NAME_COLLISION, ERROR_ALREADY_EXISTS); + cmp2(STATUS_OBJECT_NAME_EXISTS, ERROR_OBJECT_NAME_EXISTS); cmp(STATUS_OBJECT_PATH_INVALID, ERROR_BAD_PATHNAME); cmp(STATUS_OBJECT_PATH_NOT_FOUND, ERROR_PATH_NOT_FOUND); cmp(STATUS_DFS_EXIT_PATH_FOUND, ERROR_PATH_NOT_FOUND); @@ -288,14 +331,19 @@ cmp(STATUS_DATA_OVERRUN, ERROR_IO_DEVICE); cmp(STATUS_DATA_LATE_ERROR, ERROR_IO_DEVICE); cmp(STATUS_DATA_ERROR, ERROR_CRC); + cmp2(STATUS_DATA_NOT_ACCEPTED, ERROR_DATA_NOT_ACCEPTED); + cmp2(STATUS_LOST_WRITEBEHIND_DATA, ERROR_LOST_WRITEBEHIND_DATA); cmp(STATUS_CRC_ERROR, ERROR_CRC); cmp(STATUS_SHARING_VIOLATION, ERROR_SHARING_VIOLATION); cmp(STATUS_QUOTA_EXCEEDED, ERROR_NOT_ENOUGH_QUOTA); + cmp2(STATUS_FS_DRIVER_REQUIRED, ERROR_FS_DRIVER_REQUIRED); cmp(STATUS_MUTANT_NOT_OWNED, ERROR_NOT_OWNER); + cmp2(STATUS_MUTANT_LIMIT_EXCEEDED, ERROR_MUTANT_LIMIT_EXCEEDED); cmp(STATUS_SEMAPHORE_LIMIT_EXCEEDED, ERROR_TOO_MANY_POSTS); cmp(STATUS_DISK_FULL, ERROR_DISK_FULL); cmp(STATUS_LOCK_NOT_GRANTED, ERROR_LOCK_VIOLATION); cmp(STATUS_FILE_LOCK_CONFLICT, ERROR_LOCK_VIOLATION); + cmp2(STATUS_NOT_TINY_STREAM, ERROR_NOT_TINY_STREAM); cmp(STATUS_NOT_A_DIRECTORY, ERROR_DIRECTORY); cmp2(STATUS_CANNOT_MAKE, ERROR_CANNOT_MAKE); cmp(STATUS_UNKNOWN_REVISION, ERROR_UNKNOWN_REVISION); @@ -322,6 +370,9 @@ cmp(STATUS_PASSWORD_RESTRICTION, ERROR_PASSWORD_RESTRICTION); cmp(STATUS_PASSWORD_EXPIRED, ERROR_PASSWORD_EXPIRED); cmp(STATUS_PASSWORD_MUST_CHANGE, ERROR_PASSWORD_MUST_CHANGE); + cmp2(STATUS_PWD_TOO_SHORT, ERROR_PWD_TOO_SHORT); + cmp2(STATUS_PWD_TOO_RECENT, ERROR_PWD_TOO_RECENT); + cmp2(STATUS_PWD_HISTORY_CONFLICT, ERROR_PWD_HISTORY_CONFLICT); cmp(STATUS_ACCOUNT_DISABLED, ERROR_ACCOUNT_DISABLED); cmp(STATUS_ACCOUNT_LOCKED_OUT, ERROR_ACCOUNT_LOCKED_OUT); cmp(STATUS_NONE_MAPPED, ERROR_NONE_MAPPED); @@ -332,6 +383,7 @@ cmp(STATUS_INVALID_SID, ERROR_INVALID_SID); cmp(STATUS_INVALID_SECURITY_DESCR, ERROR_INVALID_SECURITY_DESCR); cmp(STATUS_PROCEDURE_NOT_FOUND, ERROR_PROC_NOT_FOUND); + cmp2(STATUS_VDM_HARD_ERROR, ERROR_VDM_HARD_ERROR); cmp2(STATUS_INVALID_LDT_SIZE, ERROR_INVALID_LDT_SIZE); cmp2(STATUS_INVALID_LDT_OFFSET, ERROR_INVALID_LDT_OFFSET); cmp2(STATUS_INVALID_LDT_DESCRIPTOR, ERROR_INVALID_LDT_DESCRIPTOR); @@ -349,11 +401,14 @@ cmp2(STATUS_INVALID_IMAGE_WIN_64, ERROR_BAD_EXE_FORMAT); cmp(STATUS_NO_TOKEN, ERROR_NO_TOKEN); cmp(STATUS_RANGE_NOT_LOCKED, ERROR_NOT_LOCKED); + cmp2(STATUS_RANGE_LIST_CONFLICT, ERROR_RANGE_LIST_CONFLICT); + cmp2(STATUS_RANGE_NOT_FOUND, ERROR_RANGE_NOT_FOUND); cmp(STATUS_SERVER_DISABLED, ERROR_SERVER_DISABLED); cmp(STATUS_SERVER_NOT_DISABLED, ERROR_SERVER_NOT_DISABLED); cmp(STATUS_INVALID_ID_AUTHORITY, ERROR_INVALID_ID_AUTHORITY); cmp(STATUS_ALLOTTED_SPACE_EXCEEDED, ERROR_ALLOTTED_SPACE_EXCEEDED); cmp(STATUS_TOO_MANY_PAGING_FILES, ERROR_NOT_ENOUGH_MEMORY); + cmp2(STATUS_RESOURCE_REQUIREMENTS_CHANGED, ERROR_RESOURCE_REQUIREMENTS_CHANGED); cmp(STATUS_INSUFFICIENT_RESOURCES, ERROR_NO_SYSTEM_RESOURCES); cmp(STATUS_INSUFF_SERVER_RESOURCES, ERROR_NOT_ENOUGH_SERVER_MEMORY); cmp(STATUS_FILE_INVALID, ERROR_FILE_INVALID); @@ -365,12 +420,17 @@ cmp(STATUS_DEVICE_NOT_READY, ERROR_NOT_READY); cmp3(STATUS_DEVICE_NOT_CONNECTED, ERROR_DEVICE_NOT_CONNECTED, ERROR_NOT_READY); cmp(STATUS_DEVICE_POWER_FAILURE, ERROR_NOT_READY); + cmp2(STATUS_INSUFFICIENT_POWER, ERROR_INSUFFICIENT_POWER); + cmp2(STATUS_DRIVER_FAILED_SLEEP, ERROR_DRIVER_FAILED_SLEEP); cmp2(STATUS_NOT_FOUND, ERROR_NOT_FOUND); cmp2(STATUS_NO_MATCH, ERROR_NO_MATCH); + cmp2(STATUS_NO_MORE_MATCHES, ERROR_NO_MORE_MATCHES); cmp2(STATUS_PROPSET_NOT_FOUND, ERROR_SET_NOT_FOUND); + cmp2(STATUS_FOUND_OUT_OF_SCOPE, ERROR_FOUND_OUT_OF_SCOPE); cmp(STATUS_DEVICE_BUSY, ERROR_BUSY); cmp(STATUS_FREE_VM_NOT_AT_BASE, ERROR_INVALID_ADDRESS); cmp(STATUS_MEMORY_NOT_ALLOCATED, ERROR_INVALID_ADDRESS); + cmp2(STATUS_ALLOCATE_BUCKET, ERROR_ALLOCATE_BUCKET); cmp(STATUS_NOT_SAME_DEVICE, ERROR_NOT_SAME_DEVICE); cmp(STATUS_NOT_SUPPORTED, ERROR_NOT_SUPPORTED); cmp(STATUS_REMOTE_NOT_LISTENING, ERROR_REM_NOT_LIST); @@ -381,6 +441,7 @@ cmp(STATUS_DEVICE_DOES_NOT_EXIST, ERROR_DEV_NOT_EXIST); cmp(STATUS_TOO_MANY_COMMANDS, ERROR_TOO_MANY_CMDS); cmp(STATUS_ADAPTER_HARDWARE_ERROR, ERROR_ADAP_HDW_ERR); + cmp2(STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT,ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT); cmp(STATUS_REDIRECTOR_NOT_STARTED, ERROR_PATH_NOT_FOUND); cmp(STATUS_INVALID_EA_NAME, ERROR_INVALID_EA_NAME); cmp(STATUS_EA_LIST_INCONSISTENT, ERROR_EA_LIST_INCONSISTENT); @@ -391,6 +452,8 @@ cmp(STATUS_EA_CORRUPT_ERROR, ERROR_FILE_CORRUPT); cmp(STATUS_NONEXISTENT_EA_ENTRY, ERROR_FILE_CORRUPT); cmp(STATUS_NO_EAS_ON_FILE, ERROR_FILE_CORRUPT); + cmp2(STATUS_REPARSE, ERROR_REPARSE); + cmp2(STATUS_REPARSE_OBJECT, ERROR_REPARSE_OBJECT); cmp2(STATUS_NOT_A_REPARSE_POINT, ERROR_NOT_A_REPARSE_POINT); cmp4(STATUS_IO_REPARSE_TAG_INVALID, ERROR_REPARSE_TAG_INVALID, ERROR_INVALID_PARAMETER); cmp4(STATUS_IO_REPARSE_TAG_MISMATCH, ERROR_REPARSE_TAG_MISMATCH, ERROR_INVALID_PARAMETER); @@ -406,6 +469,7 @@ cmp2(STATUS_JOURNAL_DELETE_IN_PROGRESS, ERROR_JOURNAL_DELETE_IN_PROGRESS); cmp2(STATUS_JOURNAL_NOT_ACTIVE, ERROR_JOURNAL_NOT_ACTIVE); cmp2(STATUS_JOURNAL_ENTRY_DELETED, ERROR_JOURNAL_ENTRY_DELETED); + cmp2(STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED,ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED); cmp(STATUS_INVALID_NETWORK_RESPONSE, ERROR_BAD_NET_RESP); cmp(STATUS_USER_SESSION_DELETED, ERROR_UNEXP_NET_ERR); cmp(STATUS_UNEXPECTED_NETWORK_ERROR, ERROR_UNEXP_NET_ERR); @@ -423,6 +487,7 @@ cmp(STATUS_TOO_MANY_NODES, ERROR_TOO_MANY_NAMES); cmp(STATUS_TOO_MANY_SESSIONS, ERROR_TOO_MANY_SESS); cmp(STATUS_SHARING_PAUSED, ERROR_SHARING_PAUSED); + cmp2(STATUS_CANT_ENABLE_DENY_ONLY, ERROR_CANT_ENABLE_DENY_ONLY); cmp(STATUS_REQUEST_NOT_ACCEPTED, ERROR_REQ_NOT_ACCEP); cmp(STATUS_REDIRECTOR_PAUSED, ERROR_REDIR_PAUSED); cmp(STATUS_NET_WRITE_FAULT, ERROR_NET_WRITE_FAULT); @@ -452,6 +517,7 @@ cmp(STATUS_END_OF_MEDIA, ERROR_END_OF_MEDIA); cmp(STATUS_EOM_OVERFLOW, ERROR_EOM_OVERFLOW); cmp(STATUS_BEGINNING_OF_MEDIA, ERROR_BEGINNING_OF_MEDIA); + cmp2(STATUS_MEDIA_CHECK, ERROR_MEDIA_CHECK); cmp(STATUS_MEDIA_CHANGED, ERROR_MEDIA_CHANGED); cmp(STATUS_BUS_RESET, ERROR_BUS_RESET); cmp(STATUS_FILEMARK_DETECTED, ERROR_FILEMARK_DETECTED); @@ -462,12 +528,32 @@ cmp(STATUS_DEVICE_NOT_PARTITIONED, ERROR_DEVICE_NOT_PARTITIONED); cmp(STATUS_UNABLE_TO_LOCK_MEDIA, ERROR_UNABLE_TO_LOCK_MEDIA); cmp(STATUS_UNABLE_TO_UNLOAD_MEDIA, ERROR_UNABLE_TO_UNLOAD_MEDIA); + cmp2(STATUS_ILLEGAL_CHARACTER, ERROR_ILLEGAL_CHARACTER); cmp(STATUS_UNMAPPABLE_CHARACTER, ERROR_NO_UNICODE_TRANSLATION); + cmp2(STATUS_UNDEFINED_CHARACTER, ERROR_UNDEFINED_CHARACTER); + cmp2(STATUS_TRANSLATION_COMPLETE, ERROR_TRANSLATION_COMPLETE); cmp(STATUS_NOT_ALL_ASSIGNED, ERROR_NOT_ALL_ASSIGNED); cmp(STATUS_SOME_NOT_MAPPED, ERROR_SOME_NOT_MAPPED); cmp(STATUS_NO_QUOTAS_FOR_ACCOUNT, ERROR_NO_QUOTAS_FOR_ACCOUNT); + cmp2(STATUS_QUOTA_LIST_INCONSISTENT, ERROR_QUOTA_LIST_INCONSISTENT); cmp(STATUS_LOCAL_USER_SESSION_KEY, ERROR_LOCAL_USER_SESSION_KEY); cmp(STATUS_NULL_LM_PASSWORD, ERROR_NULL_LM_PASSWORD); + cmp2(STATUS_SYNCHRONIZATION_REQUIRED, ERROR_SYNCHRONIZATION_REQUIRED); + cmp2(STATUS_WAKE_SYSTEM_DEBUGGER, ERROR_WAKE_SYSTEM_DEBUGGER); + cmp2(DBG_EXCEPTION_HANDLED, ERROR_DBG_EXCEPTION_HANDLED); + cmp2(DBG_CONTINUE, ERROR_DBG_CONTINUE); + cmp2(DBG_TERMINATE_THREAD, ERROR_DBG_TERMINATE_THREAD); + cmp2(DBG_TERMINATE_PROCESS, ERROR_DBG_TERMINATE_PROCESS); + cmp2(DBG_CONTROL_C, ERROR_DBG_CONTROL_C); + cmp2(DBG_PRINTEXCEPTION_C, ERROR_DBG_PRINTEXCEPTION_C); + cmp2(DBG_RIPEXCEPTION, ERROR_DBG_RIPEXCEPTION); + cmp2(DBG_CONTROL_BREAK, ERROR_DBG_CONTROL_BREAK); + cmp2(DBG_COMMAND_EXCEPTION, ERROR_DBG_COMMAND_EXCEPTION); + cmp2(DBG_EXCEPTION_NOT_HANDLED, ERROR_DBG_EXCEPTION_NOT_HANDLED); + cmp2(STATUS_DEBUG_ATTACH_FAILED, ERROR_DEBUG_ATTACH_FAILED); + cmp2(STATUS_VALIDATE_CONTINUE, ERROR_VALIDATE_CONTINUE); + cmp2(STATUS_EXTRANEOUS_INFORMATION, ERROR_EXTRANEOUS_INFORMATION); + cmp2(STATUS_GUID_SUBSTITUTION_MADE, ERROR_GUID_SUBSTITUTION_MADE); cmp2(STATUS_IMAGE_MACHINE_TYPE_MISMATCH, ERROR_IMAGE_MACHINE_TYPE_MISMATCH); cmp2(STATUS_RECEIVE_PARTIAL, ERROR_RECEIVE_PARTIAL); cmp2(STATUS_RECEIVE_EXPEDITED, ERROR_RECEIVE_EXPEDITED); @@ -485,9 +571,30 @@ cmp2(STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE, ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE); cmp2(STATUS_NO_YIELD_PERFORMED, ERROR_NO_YIELD_PERFORMED); cmp2(STATUS_TIMER_RESUME_IGNORED, ERROR_TIMER_RESUME_IGNORED); + cmp2(STATUS_TIMER_RESOLUTION_NOT_SET, ERROR_TIMER_RESOLUTION_NOT_SET); + cmp2(STATUS_ARBITRATION_UNHANDLED, ERROR_ARBITRATION_UNHANDLED); + cmp2(STATUS_CARDBUS_NOT_SUPPORTED, ERROR_CARDBUS_NOT_SUPPORTED); + cmp2(STATUS_MP_PROCESSOR_MISMATCH, ERROR_MP_PROCESSOR_MISMATCH); + cmp2(STATUS_HIBERNATED, ERROR_HIBERNATED); + cmp2(STATUS_RESUME_HIBERNATION, ERROR_RESUME_HIBERNATION); + cmp2(STATUS_FIRMWARE_UPDATED, ERROR_FIRMWARE_UPDATED); + cmp2(STATUS_WAKE_SYSTEM, ERROR_WAKE_SYSTEM); + cmp2(STATUS_WAIT_1, ERROR_WAIT_1); + cmp2(STATUS_WAIT_2, ERROR_WAIT_2); + cmp2(STATUS_WAIT_3, ERROR_WAIT_3); + cmp2(STATUS_WAIT_63, ERROR_WAIT_63); + cmp2(STATUS_ABANDONED_WAIT_0, ERROR_WAIT_NO_CHILDREN); + cmp2(STATUS_ABANDONED_WAIT_63, ERROR_ABANDONED_WAIT_63); + cmp2(STATUS_USER_APC, ERROR_USER_APC); + cmp2(STATUS_KERNEL_APC, ERROR_KERNEL_APC); + cmp2(STATUS_ALERTED, ERROR_ALERTED); + cmp2(STATUS_NOTIFY_CLEANUP, ERROR_NOTIFY_CLEANUP); + cmp2(STATUS_NO_CALLBACK_ACTIVE, ERROR_NO_CALLBACK_ACTIVE); + cmp4(STATUS_NOINTERFACE, ERROR_NOINTERFACE, E_NOINTERFACE); cmp(STATUS_BAD_INHERITANCE_ACL, ERROR_BAD_INHERITANCE_ACL); cmp(STATUS_INVALID_GROUP_ATTRIBUTES, ERROR_INVALID_GROUP_ATTRIBUTES); cmp(STATUS_BAD_IMPERSONATION_LEVEL, ERROR_BAD_IMPERSONATION_LEVEL); + cmp2(STATUS_ELEVATION_REQUIRED, ERROR_ELEVATION_REQUIRED); cmp(STATUS_CANT_OPEN_ANONYMOUS, ERROR_CANT_OPEN_ANONYMOUS); cmp(STATUS_BAD_VALIDATION_CLASS, ERROR_BAD_VALIDATION_CLASS); cmp(STATUS_BAD_TOKEN_TYPE, ERROR_BAD_TOKEN_TYPE); @@ -502,6 +609,7 @@ cmp(STATUS_DOMAIN_LIMIT_EXCEEDED, ERROR_DOMAIN_LIMIT_EXCEEDED); cmp2(STATUS_OPLOCK_NOT_GRANTED, ERROR_OPLOCK_NOT_GRANTED); cmp2(STATUS_INVALID_OPLOCK_PROTOCOL, ERROR_INVALID_OPLOCK_PROTOCOL); + cmp2(STATUS_OPLOCK_BREAK_IN_PROGRESS, ERROR_OPLOCK_BREAK_IN_PROGRESS); cmp(STATUS_INTERNAL_DB_CORRUPTION, ERROR_INTERNAL_DB_CORRUPTION); cmp(STATUS_INTERNAL_ERROR, ERROR_INTERNAL_ERROR); cmp(STATUS_GENERIC_NOT_MAPPED, ERROR_GENERIC_NOT_MAPPED); @@ -512,7 +620,12 @@ cmp(STATUS_BAD_LOGON_SESSION_STATE, ERROR_BAD_LOGON_SESSION_STATE); cmp(STATUS_LOGON_SESSION_COLLISION, ERROR_LOGON_SESSION_COLLISION); cmp(STATUS_INVALID_LOGON_TYPE, ERROR_INVALID_LOGON_TYPE); + cmp2(STATUS_LOGON_SERVER_CONFLICT, ERROR_LOGON_SERVER_CONFLICT); + cmp2(STATUS_SERVER_SID_MISMATCH, ERROR_SERVER_SID_MISMATCH); + cmp2(STATUS_RXACT_STATE_CREATED, ERROR_RXACT_STATE_CREATED); cmp(STATUS_RXACT_INVALID_STATE, ERROR_RXACT_INVALID_STATE); + cmp2(STATUS_RXACT_COMMITTED, ERROR_RXACT_COMMITTED); + cmp2(STATUS_RXACT_COMMIT_NECESSARY, ERROR_RXACT_COMMIT_NECESSARY); cmp(STATUS_RXACT_COMMIT_FAILURE, ERROR_RXACT_COMMIT_FAILURE); cmp(STATUS_SPECIAL_ACCOUNT, ERROR_SPECIAL_ACCOUNT); cmp(STATUS_SPECIAL_USER, ERROR_SPECIAL_USER); @@ -532,6 +645,8 @@ cmp(STATUS_NO_SUCH_MEMBER, ERROR_NO_SUCH_MEMBER); cmp(STATUS_INVALID_MEMBER, ERROR_INVALID_MEMBER); cmp(STATUS_TOO_MANY_SIDS, ERROR_TOO_MANY_SIDS); + cmp2(STATUS_ALL_SIDS_FILTERED, ERROR_ALL_SIDS_FILTERED); + cmp2(STATUS_INSUFFICIENT_LOGON_INFO, ERROR_INSUFFICIENT_LOGON_INFO); cmp(STATUS_LM_CROSS_ENCRYPTION_REQUIRED, ERROR_LM_CROSS_ENCRYPTION_REQUIRED); cmp(STATUS_MESSAGE_NOT_FOUND, ERROR_MR_MID_NOT_FOUND); cmp2(STATUS_CONTROL_C_EXIT, ERROR_CONTROL_C_EXIT); @@ -542,12 +657,20 @@ cmp(STATUS_LINK_TIMEOUT, ERROR_UNEXP_NET_ERR); cmp(STATUS_INVALID_CONNECTION, ERROR_UNEXP_NET_ERR); cmp(STATUS_INVALID_ADDRESS, ERROR_UNEXP_NET_ERR); + cmp2(STATUS_IP_ADDRESS_CONFLICT1, ERROR_IP_ADDRESS_CONFLICT1); + cmp2(STATUS_IP_ADDRESS_CONFLICT2, ERROR_IP_ADDRESS_CONFLICT2); cmp2(STATUS_MISSING_SYSTEMFILE, ERROR_MISSING_SYSTEMFILE); - cmp2(STATUS_PAGEFILE_CREATE_FAILED, ERROR_PAGEFILE_CREATE_FAILED); + cmp2(STATUS_CORRUPT_SYSTEM_FILE, ERROR_CORRUPT_SYSTEM_FILE); + cmp2(STATUS_SYSTEM_IMAGE_BAD_SIGNATURE, ERROR_SYSTEM_IMAGE_BAD_SIGNATURE); + cmp2(STATUS_CRASH_DUMP, ERROR_CRASH_DUMP); + cmp2(STATUS_LONGJUMP, ERROR_LONGJUMP); + cmp2(STATUS_UNWIND_CONSOLIDATE, ERROR_UNWIND_CONSOLIDATE); cmp2(STATUS_UNHANDLED_EXCEPTION, ERROR_UNHANDLED_EXCEPTION); + cmp2(STATUS_MCA_OCCURED, ERROR_MCA_OCCURED); cmp2(STATUS_APP_INIT_FAILURE, ERROR_APP_INIT_FAILURE); - cmp2(STATUS_NO_PAGEFILE, ERROR_NO_PAGEFILE); cmp2(STATUS_ILLEGAL_FLOAT_CONTEXT, ERROR_ILLEGAL_FLOAT_CONTEXT); + cmp2(STATUS_FLOAT_MULTIPLE_FAULTS, ERROR_FLOAT_MULTIPLE_FAULTS); + cmp2(STATUS_FLOAT_MULTIPLE_TRAPS, ERROR_FLOAT_MULTIPLE_TRAPS); cmp2(STATUS_NO_EVENT_PAIR, ERROR_NO_EVENT_PAIR); cmp2(STATUS_DOMAIN_CTRLR_CONFIG_ERROR, ERROR_DOMAIN_CTRLR_CONFIG_ERROR); cmp(STATUS_IO_DEVICE_ERROR, ERROR_IO_DEVICE); @@ -555,6 +678,8 @@ cmp(STATUS_DRIVER_INTERNAL_ERROR, ERROR_IO_DEVICE); cmp(STATUS_INVALID_DEVICE_STATE, ERROR_BAD_COMMAND); cmp(STATUS_DEVICE_CONFIGURATION_ERROR, ERROR_INVALID_PARAMETER); + cmp2(STATUS_DEVICE_ENUMERATION_ERROR, ERROR_DEVICE_ENUMERATION_ERROR); + cmp2(STATUS_INVALID_DEVICE_OBJECT_PARAMETER, ERROR_INVALID_DEVICE_OBJECT_PARAMETER); cmp2(STATUS_SOURCE_ELEMENT_EMPTY, ERROR_SOURCE_ELEMENT_EMPTY); cmp2(STATUS_DESTINATION_ELEMENT_FULL, ERROR_DESTINATION_ELEMENT_FULL); cmp2(STATUS_ILLEGAL_ELEMENT_ADDRESS, ERROR_ILLEGAL_ELEMENT_ADDRESS); @@ -575,7 +700,10 @@ cmp2(STATUS_NOT_EXPORT_FORMAT, ERROR_NOT_EXPORT_FORMAT); cmp2(STATUS_FILE_ENCRYPTED, ERROR_FILE_ENCRYPTED); cmp2(STATUS_EFS_ALG_BLOB_TOO_BIG, ERROR_EFS_ALG_BLOB_TOO_BIG); + cmp2(STATUS_BUFFER_ALL_ZEROS, ERROR_BUFFER_ALL_ZEROS); cmp(STATUS_INVALID_USER_BUFFER, ERROR_INVALID_USER_BUFFER); + cmp2(STATUS_BAD_COMPRESSION_BUFFER, ERROR_BAD_COMPRESSION_BUFFER); + cmp2(STATUS_UNSUPPORTED_COMPRESSION, ERROR_UNSUPPORTED_COMPRESSION); cmp(STATUS_SERIAL_NO_DEVICE_INITED, ERROR_SERIAL_NO_DEVICE); cmp(STATUS_SHARED_IRQ_BUSY, ERROR_IRQ_BUSY); cmp(STATUS_SERIAL_MORE_WRITES, ERROR_MORE_WRITES); @@ -584,6 +712,7 @@ cmp(STATUS_FLOPPY_WRONG_CYLINDER, ERROR_FLOPPY_WRONG_CYLINDER); cmp(STATUS_FLOPPY_UNKNOWN_ERROR, ERROR_FLOPPY_UNKNOWN_ERROR); cmp(STATUS_FLOPPY_BAD_REGISTERS, ERROR_FLOPPY_BAD_REGISTERS); + cmp2(STATUS_FLOPPY_VOLUME, ERROR_FLOPPY_VOLUME); cmp(STATUS_DISK_RECALIBRATE_FAILED, ERROR_DISK_RECALIBRATE_FAILED); cmp(STATUS_DISK_OPERATION_FAILED, ERROR_DISK_OPERATION_FAILED); cmp(STATUS_DISK_RESET_FAILED, ERROR_DISK_RESET_FAILED); @@ -609,8 +738,14 @@ cmp(STATUS_TRANSACTION_INVALID_TYPE, ERROR_UNEXP_NET_ERR); cmp(STATUS_NOT_SERVER_SESSION, ERROR_NOT_SUPPORTED); cmp(STATUS_NOT_CLIENT_SESSION, ERROR_NOT_SUPPORTED); + cmp2(STATUS_CLIENT_SERVER_PARAMETERS_INVALID,ERROR_CLIENT_SERVER_PARAMETERS_INVALID); cmp(STATUS_USER_MAPPED_FILE, ERROR_USER_MAPPED_FILE); + cmp2(STATUS_INVALID_HW_PROFILE, ERROR_INVALID_HW_PROFILE); cmp(STATUS_PLUGPLAY_NO_DEVICE, ERROR_SERVICE_DISABLED); + cmp2(STATUS_PLUGPLAY_QUERY_VETOED, ERROR_PLUGPLAY_QUERY_VETOED); + cmp2(STATUS_INVALID_PLUGPLAY_DEVICE_PATH, ERROR_INVALID_PLUGPLAY_DEVICE_PATH); + cmp2(STATUS_PNP_RESTART_ENUMERATION, ERROR_PNP_RESTART_ENUMERATION); + cmp2(STATUS_PNP_REBOOT_REQUIRED, ERROR_PNP_REBOOT_REQUIRED); cmp2(STATUS_WMI_GUID_NOT_FOUND, ERROR_WMI_GUID_NOT_FOUND); cmp2(STATUS_WMI_INSTANCE_NOT_FOUND, ERROR_WMI_INSTANCE_NOT_FOUND); cmp2(STATUS_WMI_ITEMID_NOT_FOUND, ERROR_WMI_ITEMID_NOT_FOUND); @@ -815,6 +950,7 @@ cmp2(CRYPT_E_REVOCATION_OFFLINE, ERROR_MUTUAL_AUTH_FAILED); cmp2(STATUS_SHUTDOWN_IN_PROGRESS, ERROR_SHUTDOWN_IN_PROGRESS); cmp2(STATUS_SERVER_SHUTDOWN_IN_PROGRESS, ERROR_SERVER_SHUTDOWN_IN_PROGRESS); + cmp2(STATUS_SYSTEM_SHUTDOWN, ERROR_SYSTEM_SHUTDOWN); cmp4(STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY, ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY, 1922); cmp4(STATUS_DS_NO_ATTRIBUTE_OR_VALUE, ERROR_DS_NO_ATTRIBUTE_OR_VALUE, 1923); cmp4(STATUS_DS_INVALID_ATTRIBUTE_SYNTAX, ERROR_DS_INVALID_ATTRIBUTE_SYNTAX, 1924); @@ -857,6 +993,7 @@ cmp2(STATUS_SAM_NEED_BOOTKEY_FLOPPY, ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY); cmp2(STATUS_DS_INIT_FAILURE_CONSOLE, ERROR_DS_INIT_FAILURE_CONSOLE); cmp2(STATUS_DS_SAM_INIT_FAILURE_CONSOLE, ERROR_DS_SAM_INIT_FAILURE_CONSOLE); + cmp2(STATUS_DS_VERSION_CHECK_FAILURE, ERROR_DS_VERSION_CHECK_FAILURE); cmp2(STATUS_UNFINISHED_CONTEXT_DELETED, SEC_E_UNFINISHED_CONTEXT_DELETED); cmp2(STATUS_NO_TGT_REPLY, SEC_E_NO_TGT_REPLY); cmp2(STATUS_NO_IP_ADDRESSES, SEC_E_NO_IP_ADDRESSES); @@ -881,6 +1018,7 @@ cmp2(STATUS_NOT_SUPPORTED_ON_SBS, ERROR_NOT_SUPPORTED_ON_SBS); cmp2(STATUS_DRIVER_BLOCKED_CRITICAL, ERROR_DRIVER_BLOCKED); cmp2(STATUS_DRIVER_BLOCKED, ERROR_DRIVER_BLOCKED); + cmp2(STATUS_DRIVER_CANCEL_TIMEOUT, ERROR_DRIVER_CANCEL_TIMEOUT); cmp2(STATUS_PRENT4_MACHINE_ACCOUNT, ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4); cmp2(STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER,ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER); cmp2(STATUS_DS_SHUTTING_DOWN, ERROR_DS_SHUTTING_DOWN); @@ -926,6 +1064,7 @@ cmp2(STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE, ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE); cmp2(STATUS_CTX_SHADOW_NOT_RUNNING, ERROR_CTX_SHADOW_NOT_RUNNING); cmp2(STATUS_LICENSE_VIOLATION, ERROR_CTX_LICENSE_NOT_AVAILABLE); + cmp2(STATUS_EVALUATION_EXPIRATION, ERROR_EVALUATION_EXPIRATION); cmp2(STATUS_NETWORK_SESSION_EXPIRED, ERROR_NO_USER_SESSION_KEY); cmp2(STATUS_FILES_OPEN, ERROR_OPEN_FILES); cmp2(STATUS_SXS_SECTION_NOT_FOUND, ERROR_SXS_SECTION_NOT_FOUND); @@ -968,6 +1107,7 @@ cmp2(STATUS_SXS_FILE_HASH_MISSING, ERROR_SXS_FILE_HASH_MISSING); cmp2(STATUS_REDIRECTOR_STARTED, ERROR_SERVICE_ALREADY_RUNNING); cmp2(STATUS_AUDITING_DISABLED, ERROR_AUDITING_DISABLED); + cmp2(STATUS_AUDIT_FAILED, ERROR_AUDIT_FAILED); cmp2(STATUS_CLUSTER_NODE_ALREADY_UP, ERROR_CLUSTER_NODE_ALREADY_UP); cmp2(STATUS_CLUSTER_NODE_ALREADY_DOWN, ERROR_CLUSTER_NODE_ALREADY_DOWN); cmp2(STATUS_CLUSTER_NETWORK_ALREADY_ONLINE, ERROR_CLUSTER_NETWORK_ALREADY_ONLINE); Modified: trunk/rostests/winetests/ntdll/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/file.c?re…
============================================================================== --- trunk/rostests/winetests/ntdll/file.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/file.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -704,7 +704,7 @@ apc_count = 0; U(iosb).Status = 0xdeadbabe; iosb.Information = 0xdeadbeef; - ok( !is_signaled( read ), "read handle is not signaled\n" ); + ok( !is_signaled( read ), "read handle is signaled\n" ); status = pNtReadFile( read, 0, apc, &apc_count, &iosb, buffer, 1, NULL, NULL ); ok( status == STATUS_PENDING, "wrong status %x\n", status ); ok( !is_signaled( read ), "read handle is signaled\n" ); @@ -717,7 +717,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 1, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( read ), "read handle is signaled\n" ); + ok( is_signaled( read ), "read handle is not signaled\n" ); ok( !apc_count, "apc was called\n" ); apc_count = 0; SleepEx( 1, FALSE ); /* non-alertable sleep */ @@ -758,7 +758,7 @@ ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* partial read is good enough */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 1, "wrong info %lu\n", iosb.Information ); ok( !apc_count, "apc was called\n" ); @@ -789,7 +789,7 @@ ok( status == STATUS_INVALID_HANDLE, "wrong status %x\n", status ); ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); /* not reset on invalid handle */ + ok( is_signaled( event ), "event is not signaled\n" ); /* not reset on invalid handle */ ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( !apc_count, "apc was called\n" ); @@ -809,7 +809,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == STATUS_PIPE_BROKEN, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -834,7 +834,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -860,7 +860,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -886,7 +886,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -912,7 +912,7 @@ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 2, "apc was not called\n" ); @@ -933,7 +933,7 @@ if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 ); ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -950,7 +950,7 @@ if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 ); ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -967,7 +967,7 @@ WaitForSingleObject( event, 1000 ); ok( U(iosb).Status == STATUS_END_OF_FILE, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -988,7 +988,7 @@ if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 ); ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); @@ -1002,7 +1002,7 @@ ok( status == STATUS_SUCCESS, "wrong status %x\n", status ); ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information ); - ok( is_signaled( event ), "event is signaled\n" ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ todo_wine ok( !apc_count, "apc was called\n" ); @@ -1164,39 +1164,6 @@ ok( hslot != 0, "Handle is invalid\n"); if ( rc == STATUS_SUCCESS ) pNtClose(hslot); - - /* - * Test that the length field is checked properly - */ - attr.Length = 0; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); - - attr.Length = sizeof(OBJECT_ATTRIBUTES)+1; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); - - /* - * Test handling of a NULL unicode string in ObjectName - */ - InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL); - attr.ObjectName = NULL; - rc = pNtCreateMailslotFile(&hslot, DesiredAccess, - &attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize, - &TimeOut); - ok( rc == STATUS_OBJECT_PATH_SYNTAX_BAD || - rc == STATUS_INVALID_PARAMETER, - "rc = %x not STATUS_OBJECT_PATH_SYNTAX_BAD or STATUS_INVALID_PARAMETER\n", rc); - - if (rc == STATUS_SUCCESS) pNtClose(hslot); /* * Test a valid call @@ -4553,8 +4520,7 @@ dwret = NtQueryInformationFile(hJunction, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation); ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret); ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart, - "Junction point folder's access time does not match (0x%llx != 0x%llx).\n", - new_attrib.LastAccessTime.QuadPart, old_attrib.LastAccessTime.QuadPart); + "Junction point folder's access time does not match.\n"); CloseHandle(hJunction); /* Check deleting a junction point as if it were a directory */ Modified: trunk/rostests/winetests/ntdll/pipe.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/pipe.c?re…
============================================================================== --- trunk/rostests/winetests/ntdll/pipe.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/pipe.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -126,7 +126,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - timeout.QuadPart = -100000000000ll; + timeout.QuadPart = -100000000; res = pNtCreateNamedPipeFile(handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, sharing, 2 /*FILE_CREATE*/, options, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout); @@ -152,7 +152,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - timeout.QuadPart = -100000000000ll; + timeout.QuadPart = -100000000; /* create a pipe with FILE_OVERWRITE */ res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ, 4 /*FILE_OVERWRITE*/, @@ -277,10 +277,9 @@ ok(!res, "NtCreateNamedPipeFile returned %x\n", res); memset(&iosb, 0x55, sizeof(iosb)); - -/* try with event and apc */ res = listen_pipe(hPipe, hEvent, &iosb, TRUE); ok(res == STATUS_PENDING, "NtFsControlFile returned %x\n", res); + ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status); hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); ok(hClient != INVALID_HANDLE_VALUE, "can't open pipe, GetLastError: %x\n", GetLastError()); @@ -294,9 +293,28 @@ ok(ioapc_called, "IOAPC didn't run\n"); - CloseHandle(hEvent); CloseHandle(hPipe); CloseHandle(hClient); + + res = create_pipe(&hPipe, FILE_SHARE_READ | FILE_SHARE_WRITE, 0 /* OVERLAPPED */); + ok(!res, "NtCreateNamedPipeFile returned %x\n", res); + + hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */, + "can't open pipe, GetLastError: %x\n", GetLastError()); + + if (hClient != INVALID_HANDLE_VALUE) + { + memset(&iosb, 0x55, sizeof(iosb)); + res = listen_pipe(hPipe, hEvent, &iosb, TRUE); + ok(res == STATUS_PIPE_CONNECTED, "NtFsControlFile returned %x\n", res); + ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status); + + CloseHandle(hClient); + } + + CloseHandle(hPipe); + CloseHandle(hEvent); } static BOOL userapc_called; @@ -374,7 +392,7 @@ todo_wine ok(res == STATUS_CANCELLED, "NtFsControlFile returned %x\n", res); ok(userapc_called, "user apc didn't run\n"); - todo_wine ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status); + ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status); ok(WaitForSingleObjectEx(hEvent, 0, TRUE) == WAIT_TIMEOUT, "hEvent signaled\n"); ok(!ioapc_called, "IOAPC ran\n"); @@ -521,7 +539,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - timeout.QuadPart = -100000000000ll; + timeout.QuadPart = -100000000; /* test with INVALID_HANDLE_VALUE */ res = pNtQueryInformationFile(INVALID_HANDLE_VALUE, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23); @@ -541,7 +559,8 @@ check_pipe_handle_state(hServer, 0, 1); hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); - ok(hClient != INVALID_HANDLE_VALUE, "can't open pipe, GetLastError: %x\n", GetLastError()); + ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */, + "can't open pipe, GetLastError: %x\n", GetLastError()); check_pipe_handle_state(hServer, 0, 1); check_pipe_handle_state(hClient, 0, 0); @@ -617,7 +636,8 @@ check_pipe_handle_state(hServer, 1, 0); hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); - ok(hClient != INVALID_HANDLE_VALUE, "can't open pipe, GetLastError: %x\n", GetLastError()); + ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */, + "can't open pipe, GetLastError: %x\n", GetLastError()); check_pipe_handle_state(hServer, 1, 0); check_pipe_handle_state(hClient, 0, 0); Modified: trunk/rostests/winetests/ntdll/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/reg.c?rev…
============================================================================== --- trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -340,6 +340,7 @@ NTSTATUS status; OBJECT_ATTRIBUTES attr; ACCESS_MASK am = KEY_READ; + UNICODE_STRING str; /* All NULL */ status = pNtOpenKey(NULL, 0, NULL); @@ -360,6 +361,86 @@ attr.Length *= 2; status = pNtOpenKey(&key, am, &attr); ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08x\n", status); + + /* Zero accessmask */ + attr.Length = sizeof(attr); + status = pNtOpenKey(&key, 0, &attr); +todo_wine + ok(status == STATUS_ACCESS_DENIED, "Expected STATUS_ACCESS_DENIED, got: 0x%08x\n", status); + if (status == STATUS_SUCCESS) NtClose(key); + + /* Calling without parent key requres full registry path. */ + pRtlCreateUnicodeStringFromAsciiz( &str, "Machine" ); + InitializeObjectAttributes(&attr, &str, 0, 0, 0); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtOpenKey Failed: 0x%08x\n", status); + pRtlFreeUnicodeString( &str ); + + /* Open is case sensitive unless OBJ_CASE_INSENSITIVE is specified. */ + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\Machine" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND, "NtOpenKey Failed: 0x%08x\n", status); + + attr.Attributes = OBJ_CASE_INSENSITIVE; + status = pNtOpenKey(&key, KEY_READ, &attr); + ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status); + pNtClose(key); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_SUCCESS, "NtOpenKey failed: 0x%08x\n", status ); + pNtClose( key ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + ok( status == STATUS_SUCCESS, "NtOpenKey failed: 0x%08x\n", status ); + pNtClose( key ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Foobar" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Foobar\\Machine" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_PATH_NOT_FOUND, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Machine\\Software\\Classes" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_PATH_NOT_FOUND, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "Machine\\Software\\Classes" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Device\\Null" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtOpenKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); if (!pNtOpenKeyEx) { @@ -454,6 +535,95 @@ pRtlFreeUnicodeString( &str ); pNtDeleteKey( subkey ); pNtClose( subkey ); + + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + + pRtlCreateUnicodeStringFromAsciiz( &str, "" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08x\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08x\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Foobar" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Foobar\\Machine" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_PATH_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Machine\\Software\\Classes" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_PATH_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "Machine\\Software\\Classes" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Device\\Null" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\Machine\\Software\\Classes" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08x\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); + + /* the REGISTRY part is case-sensitive unless OBJ_CASE_INSENSITIVE is specified */ + attr.Attributes = 0; + pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\Machine\\Software\\Classes" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_OBJECT_PATH_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\REGISTRY\\Machine\\Software\\Classes" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08x\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "\\REGISTRY\\MACHINE\\SOFTWARE\\CLASSES" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08x\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); pNtClose(key); } @@ -639,7 +809,7 @@ ok(status == STATUS_SUCCESS, "NtSetValueKey Failed: 0x%08x\n", status); status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, &pi, sizeof(pi), &len); - ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_BUFFER_TOO_SMALL instead of 0x%08x\n", status); + ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08x\n", status); ok(pi.Type == 0xff00ff00, "Type=%x\n", pi.Type); ok(pi.DataLength == 0, "DataLength=%u\n", pi.DataLength); pRtlFreeUnicodeString(&ValName); @@ -1524,6 +1694,7 @@ pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + pRtlFreeUnicodeString(&str); status = pNtQueryKey(subkey, KeyCachedInformation, &cached_info, sizeof(cached_info), &len); ok(status == STATUS_SUCCESS, "NtQueryKey Failed: 0x%08x\n", status); @@ -1544,11 +1715,13 @@ pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey2"); status = pNtCreateKey(&subkey2, GENERIC_ALL, &attr, 0, 0, 0, 0); ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + pRtlFreeUnicodeString(&str); pRtlCreateUnicodeStringFromAsciiz(&str, "val"); dw = 64; status = pNtSetValueKey( subkey, &str, 0, REG_DWORD, &dw, sizeof(dw) ); ok( status == STATUS_SUCCESS, "NtSetValueKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString(&str); if (!winetest_interactive) skip("ROSTESTS-198: Causes an assert in Cm.\n"); @@ -1614,6 +1787,7 @@ pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + pRtlFreeUnicodeString(&str); status = pNtWaitForSingleObject(events[0], FALSE, &timeout); ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); @@ -1665,6 +1839,7 @@ pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + pRtlFreeUnicodeString(&str); status = pNtWaitForSingleObject(events[0], FALSE, &timeout); ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); Modified: trunk/rostests/winetests/ntdll/rtl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/rtl.c?rev…
============================================================================== --- trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -26,6 +26,9 @@ #include "ntdll_test.h" #include "inaddr.h" #include "in6addr.h" +#include "initguid.h" +#define COBJMACROS +#include "shobjidl.h" #ifndef __WINE_WINTERNL_H @@ -63,9 +66,6 @@ /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; -static PVOID (WINAPI *pWinSqmStartSession)(PVOID unknown1, DWORD unknown2, DWORD unknown3); -static BOOL (WINAPI *pWinSqmIsOptedIn)(void); -static NTSTATUS (WINAPI *pWinSqmEndSession)(PVOID unknown1); static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T); static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG); static NTSTATUS (WINAPI *pRtlDeleteTimer)(HANDLE, HANDLE, HANDLE); @@ -110,6 +110,8 @@ static NTSTATUS (WINAPI *pRtlCompressBuffer)(USHORT, const UCHAR*, ULONG, PUCHAR, ULONG, ULONG, PULONG, PVOID); static BOOL (WINAPI *pRtlIsCriticalSectionLocked)(CRITICAL_SECTION *); static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION *); +static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG); +static NTSTATUS (WINAPI *pRtlQueryPackageIdentity)(HANDLE, WCHAR*, SIZE_T*, WCHAR*, SIZE_T*, BOOLEAN*); static HMODULE hkernel32 = 0; static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -127,9 +129,6 @@ hntdll = LoadLibraryA("ntdll.dll"); ok(hntdll != 0, "LoadLibrary failed\n"); if (hntdll) { - pWinSqmStartSession = (void *)GetProcAddress(hntdll, "WinSqmStartSession"); - pWinSqmIsOptedIn = (void *)GetProcAddress(hntdll, "WinSqmIsOptedIn"); - pWinSqmEndSession = (void *)GetProcAddress(hntdll, "WinSqmEndSession"); pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory"); pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll, "RtlCompareMemoryUlong"); pRtlDeleteTimer = (void *)GetProcAddress(hntdll, "RtlDeleteTimer"); @@ -174,6 +173,8 @@ pRtlCompressBuffer = (void *)GetProcAddress(hntdll, "RtlCompressBuffer"); pRtlIsCriticalSectionLocked = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLocked"); pRtlIsCriticalSectionLockedByThread = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLockedByThread"); + pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx"); + pRtlQueryPackageIdentity = (void *)GetProcAddress(hntdll, "RtlQueryPackageIdentity"); } hkernel32 = LoadLibraryA("kernel32.dll"); ok(hkernel32 != 0, "LoadLibrary failed\n"); @@ -183,48 +184,6 @@ strcpy((char*)src_aligned_block, src_src); ok(strlen(src) == 15, "Source must be 16 bytes long!\n"); } - -#ifdef __i386__ -const char stdcall3_thunk[] = - "\x56" /* push %esi */ - "\x89\xE6" /* mov %esp, %esi */ - "\xFF\x74\x24\x14" /* pushl 20(%esp) */ - "\xFF\x74\x24\x14" /* pushl 20(%esp) */ - "\xFF\x74\x24\x14" /* pushl 20(%esp) */ - "\xFF\x54\x24\x14" /* calll 20(%esp) */ - "\x89\xF0" /* mov %esi, %eax */ - "\x29\xE0" /* sub %esp, %eax */ - "\x89\xF4" /* mov %esi, %esp */ - "\x5E" /* pop %esi */ - "\xC2\x10\x00" /* ret $16 */ -; - -static INT (WINAPI *call_stdcall_func3)(PVOID func, PVOID arg0, DWORD arg1, DWORD arg2) = NULL; - -static void test_WinSqm(void) -{ - INT args; - - if (!pWinSqmStartSession) - { - win_skip("WinSqmStartSession() is not available\n"); - return; - } - - call_stdcall_func3 = (void*) VirtualAlloc( NULL, sizeof(stdcall3_thunk) - 1, MEM_COMMIT, - PAGE_EXECUTE_READWRITE ); - memcpy( call_stdcall_func3, stdcall3_thunk, sizeof(stdcall3_thunk) - 1 ); - - args = 3 - call_stdcall_func3( pWinSqmStartSession, NULL, 0, 0 ) / 4; - ok(args == 3, "WinSqmStartSession expected to take %d arguments instead of 3\n", args); - args = 3 - call_stdcall_func3( pWinSqmIsOptedIn, NULL, 0, 0 ) / 4; - ok(args == 0, "WinSqmIsOptedIn expected to take %d arguments instead of 0\n", args); - args = 3 - call_stdcall_func3( pWinSqmEndSession, NULL, 0, 0 ) / 4; - ok(args == 1, "WinSqmEndSession expected to take %d arguments instead of 1\n", args); - - VirtualFree( call_stdcall_func3, 0, MEM_RELEASE ); -} -#endif #define COMP(str1,str2,cmplen,len) size = pRtlCompareMemory(str1, str2, cmplen); \ ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len) @@ -2010,7 +1969,7 @@ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res); ok(len == (strlen(tests[i].address) + 1) && !strcmp(buffer, tests[i].address), - "got len %d with '%s' (expected %d with '%s')\n", len, buffer, strlen(tests[i].address), tests[i].address); + "got len %d with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address); } } @@ -3165,15 +3124,113 @@ DeleteCriticalSection(&info.crit); } +static void test_RtlInitializeCriticalSectionEx(void) +{ + static const CRITICAL_SECTION_DEBUG *no_debug = (void *)~(ULONG_PTR)0; + CRITICAL_SECTION cs; + + if (!pRtlInitializeCriticalSectionEx) + { + win_skip("RtlInitializeCriticalSectionEx is not available\n"); + return; + } + + memset(&cs, 0x11, sizeof(cs)); + pRtlInitializeCriticalSectionEx(&cs, 0, 0); + ok((cs.DebugInfo != NULL && cs.DebugInfo != no_debug) || broken(cs.DebugInfo == no_debug) /* >= Win 8 */, + "expected DebugInfo != NULL and DebugInfo != ~0, got %p\n", cs.DebugInfo); + ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount); + ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount); + ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore); + ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */, + "expected SpinCount == 0, got %ld\n", cs.SpinCount); + RtlDeleteCriticalSection((PRTL_CRITICAL_SECTION)&cs); + + memset(&cs, 0x11, sizeof(cs)); + pRtlInitializeCriticalSectionEx(&cs, 0, RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO); + todo_wine + ok(cs.DebugInfo == no_debug, "expected DebugInfo == ~0, got %p\n", cs.DebugInfo); + ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount); + ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount); + ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore); + ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */, + "expected SpinCount == 0, got %ld\n", cs.SpinCount); + RtlDeleteCriticalSection((PRTL_CRITICAL_SECTION)&cs); +} + +static void test_RtlQueryPackageIdentity(void) +{ + const WCHAR programW[] = {'M','i','c','r','o','s','o','f','t','.','W','i','n','d','o','w','s','.', + 'P','h','o','t','o','s','_','8','w','e','k','y','b','3','d','8','b','b','w','e','!','A','p','p',0}; + const WCHAR fullnameW[] = {'M','i','c','r','o','s','o','f','t','.','W','i','n','d','o','w','s','.', + 'P','h','o','t','o','s', 0}; + const WCHAR appidW[] = {'A','p','p',0}; + IApplicationActivationManager *manager; + WCHAR buf1[MAX_PATH], buf2[MAX_PATH]; + HANDLE process, token; + SIZE_T size1, size2; + NTSTATUS status; + DWORD processid; + HRESULT hr; + BOOL ret; + + if (!pRtlQueryPackageIdentity) + { + win_skip("RtlQueryPackageIdentity not available\n"); + return; + } + + size1 = size2 = MAX_PATH * sizeof(WCHAR); + status = pRtlQueryPackageIdentity((HANDLE)~(ULONG_PTR)3, buf1, &size1, buf2, &size2, NULL); + ok(status == STATUS_NOT_FOUND, "expected STATUS_NOT_FOUND, got %08x\n", status); + + CoInitializeEx(0, COINIT_APARTMENTTHREADED); + hr = CoCreateInstance(&CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER, + &IID_IApplicationActivationManager, (void **)&manager); + if (FAILED(hr)) + { + todo_wine win_skip("Failed to create ApplicationActivationManager (%x)\n", hr); + goto done; + } + + hr = IApplicationActivationManager_ActivateApplication(manager, programW, NULL, + AO_NOERRORUI, &processid); + if (FAILED(hr)) + { + todo_wine win_skip("Failed to start program (%x)\n", hr); + IApplicationActivationManager_Release(manager); + goto done; + } + + process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE, FALSE, processid); + ok(process != NULL, "OpenProcess failed with %u\n", GetLastError()); + ret = OpenProcessToken(process, TOKEN_QUERY, &token); + ok(ret, "OpenProcessToken failed with error %u\n", GetLastError()); + + size1 = size2 = MAX_PATH * sizeof(WCHAR); + status = pRtlQueryPackageIdentity(token, buf1, &size1, buf2, &size2, NULL); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); + + ok(!memcmp(buf1, fullnameW, sizeof(fullnameW) - sizeof(WCHAR)), + "Expected buf1 to begin with %s, got %s\n", wine_dbgstr_w(fullnameW), wine_dbgstr_w(buf1)); + ok(size1 >= sizeof(WCHAR) && !(size1 % sizeof(WCHAR)), "Unexpected size1 = %lu\n", size1); + ok(buf1[size1 / sizeof(WCHAR) - 1] == 0, "Expected buf1[%lu] == 0\n", size1 / sizeof(WCHAR) - 1); + + ok(!lstrcmpW(buf2, appidW), "Expected buf2 to be %s, got %s\n", wine_dbgstr_w(appidW), wine_dbgstr_w(buf2)); + ok(size2 >= sizeof(WCHAR) && !(size2 % sizeof(WCHAR)), "Unexpected size2 = %lu\n", size2); + ok(buf2[size2 / sizeof(WCHAR) - 1] == 0, "Expected buf2[%lu] == 0\n", size2 / sizeof(WCHAR) - 1); + + CloseHandle(token); + TerminateProcess(process, 0); + CloseHandle(process); + +done: + CoUninitialize(); +} + START_TEST(rtl) { InitFunctionPtrs(); - -#ifdef __i386__ - test_WinSqm(); -#else - skip("stdcall-style parameter checks are not supported on this platform.\n"); -#endif test_RtlCompareMemory(); test_RtlCompareMemoryUlong(); @@ -3206,4 +3263,6 @@ test_RtlGetCompressionWorkSpaceSize(); test_RtlDecompressBuffer(); test_RtlIsCriticalSectionLocked(); -} + test_RtlInitializeCriticalSectionEx(); + test_RtlQueryPackageIdentity(); +} Modified: trunk/rostests/winetests/ntdll/rtlstr.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/rtlstr.c?…
============================================================================== --- trunk/rostests/winetests/ntdll/rtlstr.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/rtlstr.c [iso-8859-1] Tue Jul 12 20:40:20 2016 @@ -41,6 +41,8 @@ static NTSTATUS (WINAPI *pRtlAppendUnicodeStringToString)(UNICODE_STRING *, const UNICODE_STRING *); static NTSTATUS (WINAPI *pRtlAppendUnicodeToString)(UNICODE_STRING *, LPCWSTR); static NTSTATUS (WINAPI *pRtlCharToInteger)(PCSZ, ULONG, int *); +static LONG (WINAPI *pRtlCompareUnicodeString)(const UNICODE_STRING*, const UNICODE_STRING*, BOOLEAN); +static LONG (WINAPI *pRtlCompareUnicodeStrings)(const WCHAR *,SIZE_T,const WCHAR *,SIZE_T,BOOLEAN); static VOID (WINAPI *pRtlCopyString)(STRING *, const STRING *); static BOOLEAN (WINAPI *pRtlCreateUnicodeString)(PUNICODE_STRING, LPCWSTR); static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); @@ -75,7 +77,6 @@ /*static VOID (WINAPI *pRtlCopyUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *);*/ /*static VOID (WINAPI *pRtlEraseUnicodeString)(UNICODE_STRING *);*/ /*static LONG (WINAPI *pRtlCompareString)(const STRING *,const STRING *,BOOLEAN);*/ -/*static LONG (WINAPI *pRtlCompareUnicodeString)(const UNICODE_STRING *,const UNICODE_STRING *,BOOLEAN);*/ /*static BOOLEAN (WINAPI *pRtlEqualString)(const STRING *,const STRING *,BOOLEAN);*/ /*static BOOLEAN (WINAPI *pRtlPrefixString)(const STRING *, const STRING *, BOOLEAN);*/ /*static BOOLEAN (WINAPI *pRtlPrefixUnicodeString)(const UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN);*/ @@ -112,6 +113,8 @@ pRtlAppendUnicodeStringToString = (void *)GetProcAddress(hntdll, "RtlAppendUnicodeStringToString"); pRtlAppendUnicodeToString = (void *)GetProcAddress(hntdll, "RtlAppendUnicodeToString"); pRtlCharToInteger = (void *)GetProcAddress(hntdll, "RtlCharToInteger"); + pRtlCompareUnicodeString = (void *)GetProcAddress(hntdll, "RtlCompareUnicodeString"); + pRtlCompareUnicodeStrings = (void *)GetProcAddress(hntdll, "RtlCompareUnicodeStrings"); pRtlCopyString = (void *)GetProcAddress(hntdll, "RtlCopyString"); pRtlCreateUnicodeString = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeString"); pRtlCreateUnicodeStringFromAsciiz = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeStringFromAsciiz"); @@ -1856,6 +1859,36 @@ HeapFree(GetProcessHeap(), 0, be_unicode_no_controls); } +static void test_RtlCompareUnicodeString(void) +{ + WCHAR ch1, ch2; + UNICODE_STRING str1, str2; + + str1.Buffer = &ch1; + str1.Length = str1.MaximumLength = sizeof(WCHAR); + str2.Buffer = &ch2; + str2.Length = str2.MaximumLength = sizeof(WCHAR); + for (ch1 = 0; ch1 < 512; ch1++) + { + for (ch2 = 0; ch2 < 1024; ch2++) + { + LONG res = pRtlCompareUnicodeString( &str1, &str2, FALSE ); + ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 ); + res = pRtlCompareUnicodeString( &str1, &str2, TRUE ); + ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)), + "wrong result %d %04x %04x\n", res, ch1, ch2 ); + if (pRtlCompareUnicodeStrings) + { + res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, FALSE ); + ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 ); + res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, TRUE ); + ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)), + "wrong result %d %04x %04x\n", res, ch1, ch2 ); + } + } + } +} + static const WCHAR szGuid[] = { '{','0','1','0','2','0','3','0','4','-', '0','5','0','6','-' ,'0','7','0','8','-','0','9','0','A','-', '0','B','0','C','0','D','0','E','0','F','0','A','}','\0' }; @@ -2522,6 +2555,7 @@ test_RtlGUIDFromString(); test_RtlStringFromGUID(); test_RtlIsTextUnicode(); + test_RtlCompareUnicodeString(); if(0) { test_RtlUpcaseUnicodeChar();
8 years, 4 months
1
0
0
0
[zhu] 71908: Cleaned out debug printouts. Fixed all crashes for strictly serial client-handling.
by zhu@svn.reactos.org
Author: zhu Date: Tue Jul 12 20:28:05 2016 New Revision: 71908 URL:
http://svn.reactos.org/svn/reactos?rev=71908&view=rev
Log: Cleaned out debug printouts. Fixed all crashes for strictly serial client-handling. Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] Tue Jul 12 20:28:05 2016 @@ -46,8 +46,6 @@ PIO_STACK_LOCATION IrpSp; PTCP_CONTEXT Context; PTCP_REQUEST Request; - - DPRINT1("Prepare for cancel\n"); if (!Irp->Cancel) { @@ -69,7 +67,6 @@ IoSetCancelRoutine(Irp, CancelRoutine); InsertTailList(&Context->RequestListHead, &Request->ListEntry); - DPRINT1("Prepared for cancel\n"); return STATUS_SUCCESS; } @@ -101,7 +98,6 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); IrpSp = IoGetCurrentIrpStackLocation(Irp); - DPRINT1("IRP Cancel on IRP at %08x, with MinorFunction %08x\n", Irp, IrpSp->MinorFunction); switch ((ULONG)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE : @@ -109,12 +105,6 @@ case TDI_CONNECTION_FILE : Context = (PTCP_CONTEXT)IrpSp->FileObject->FsContext; goto TCP_CANCEL; - case TCP_REQUEST_STRUCT : - Irp->IoStatus.Status = STATUS_CANCELLED; - Irp->IoStatus.Information = 0; - IoSetCancelRoutine(Irp, NULL); - ExFreePoolWithTag(IrpSp->FileObject->FsContext, TAG_TCP_REQUEST); - goto FINISH; default : DPRINT1("Cancellation error\n"); goto FINISH; @@ -128,7 +118,6 @@ IoSetCancelRoutine(Irp, NULL); AddressFile = Context->AddressFile; - DPRINT1("AddressFile at %08x\n", AddressFile); Head = &Context->RequestListHead; Entry = Head->Flink; while (Entry != Head) @@ -143,7 +132,6 @@ { AddressFile->lwip_tcp_pcb = NULL; } - DPRINT1("Aborting PCB at %p\n", Context->lwip_tcp_pcb); tcp_arg(Context->lwip_tcp_pcb, NULL); tcp_abort(Context->lwip_tcp_pcb); InterlockedDecrement(&PcbCount); @@ -164,7 +152,6 @@ { AddressFile->lwip_tcp_pcb = NULL; } - DPRINT1("Closing PCB at %p\n", Context->lwip_tcp_pcb); tcp_close(Context->lwip_tcp_pcb); InterlockedDecrement(&PcbCount); DPRINT1("\n PCB Count: %d\n", PcbCount); @@ -201,8 +188,6 @@ FINISH: IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); - - DPRINT1("CancelRequestRoutine Exiting\n"); } void @@ -271,7 +256,7 @@ if (!arg) { - DPRINT1("We did the cancelling ourselves, no need to worry about deallocations\n"); + /* We did the cancelling ourselves, no need to worry about deallocations */ return; } @@ -280,12 +265,10 @@ _TCP_CONTEXT This works assuming the compiler never adds padding before the first struct member */ - DPRINT1("Type: %08x\n", *((UCHAR*)arg)); switch (*((UCHAR*)arg)) { case TDI_TRANSPORT_ADDRESS_FILE : AddressFile = (PADDRESS_FILE)arg; - DPRINT1("AddressFile at %p\n", AddressFile); KeAcquireSpinLock(&AddressFile->ContextListLock, &OldIrql); Head = &AddressFile->ContextListHead; @@ -306,8 +289,7 @@ IrpSp = IoGetCurrentIrpStackLocation(Irp); RequestEntry = RequestEntry->Flink; RemoveEntryList(&Request->ListEntry); - IrpSp->FileObject->FsContext = Request; - IrpSp->FileObject->FsContext2 = (PVOID)TCP_REQUEST_STRUCT; + ExFreePoolWithTag(Request, TAG_TCP_REQUEST); continue; } RequestEntry = RequestEntry->Flink; @@ -319,7 +301,6 @@ if (Context->lwip_tcp_pcb != AddressFile->lwip_tcp_pcb) { - DPRINT1("Aborting PCB at %p\n", Context->lwip_tcp_pcb); tcp_arg(Context->lwip_tcp_pcb, NULL); tcp_abort(Context->lwip_tcp_pcb); InterlockedDecrement(&PcbCount); @@ -337,7 +318,6 @@ return; case TDI_CONNECTION_FILE : Context = (PTCP_CONTEXT)arg; - DPRINT1("AddressFile at %p\n", Context->AddressFile); KeAcquireSpinLock(&Context->RequestListLock, &OldIrql); RequestHead = &Context->RequestListHead; @@ -351,8 +331,7 @@ IrpSp = IoGetCurrentIrpStackLocation(Irp); RequestEntry = RequestEntry->Flink; RemoveEntryList(&Request->ListEntry); - IrpSp->FileObject->FsContext = Request; - IrpSp->FileObject->FsContext2 = (PVOID)TCP_REQUEST_STRUCT; + ExFreePoolWithTag(Request, TAG_TCP_REQUEST); continue; } RequestEntry = RequestEntry->Flink; @@ -488,8 +467,6 @@ PLIST_ENTRY Head; PLIST_ENTRY Entry; - - DPRINT1("lwIP TCP Accept Callback\n"); AddressFile = (PADDRESS_FILE)arg; KeAcquireSpinLock(&AddressFile->ContextListLock, &OldIrql); @@ -589,8 +566,6 @@ err_t lwip_err; - DPRINT1("lwIP TCP Sent Callback\n"); - Context = (PTCP_CONTEXT)arg; KeAcquireSpinLock(&Context->RequestListLock, &OldIrql); @@ -691,8 +666,6 @@ NTSTATUS Status; err_t lwip_err; - DPRINT1("lwIP TCP Receive Callback\n"); - /* This error is currently unimplemented in lwIP */ /* if (err != ERR_OK) { @@ -701,8 +674,6 @@ }*/ Context = (PTCP_CONTEXT)arg; - DPRINT1("Context at %08x\n", Context); - DPRINT1("AddressFile at %08x\n", Context->AddressFile); if (!(Context->TcpState & TCP_STATE_RECEIVING)) { DPRINT1("Receive callback on connection that is not currently receiving\n"); return ERR_ARG; @@ -735,7 +706,6 @@ } /* IRP found, clear out the CANCEL flag */ - DPRINT1("IRP at %08x\n", Irp); IoSetCancelRoutine(Irp, NULL); Irp->Cancel = FALSE; @@ -811,8 +781,6 @@ } RETURN: - DPRINT1("Receive CopiedLength = %d\nReceived on PCB at %p\n", CopiedLength, tpcb); - tcp_recved(tpcb, CopiedLength); while (Entry != Head) { Request = CONTAINING_RECORD(Entry, TCP_REQUEST, ListEntry); @@ -901,8 +869,6 @@ PLIST_ENTRY Entry; err_t lwip_err; - DPRINT1("lwIP TCP Connected Callback\n"); - Context = (PTCP_CONTEXT)arg; KeAcquireSpinLock(&Context->RequestListLock, &OldIrql); Head = &Context->RequestListHead; @@ -960,8 +926,6 @@ /* See if this port is already taken, and find a free one if needed. */ KeAcquireSpinLock(&AddressListLock, &OldIrql); - - DPRINT1("Search through used ports\n"); ListEntry = AddressListHead.Flink; while (ListEntry != &AddressListHead) @@ -977,7 +941,6 @@ { /* Good, we found the shared address we were looking for */ InterlockedIncrement(&AddressFile->RefCount); - DPRINT1("RefCount increment to %d\n", AddressFile->RefCount); KeReleaseSpinLock(&AddressListLock, OldIrql); goto Success; } @@ -1004,8 +967,6 @@ } ListEntry = ListEntry->Flink; } - - DPRINT1("Find local interface for address\n"); if (!AddrIsUnspecified(Address)) { @@ -1016,7 +977,6 @@ ip4_addr_set_u32(&IpAddr, Address->in_addr); while (lwip_netif) { -// DPRINT1("Comparing against address %lx\n", lwip_netif->ip_addr.addr); if (ip_addr_cmp(&IpAddr, &lwip_netif->ip_addr)) { break; @@ -1031,8 +991,6 @@ return STATUS_INVALID_ADDRESS; } } - - DPRINT1("Allocate address file\n"); /* Allocate our new address file */ AddressFile = ExAllocatePoolWithTag(NonPagedPool, sizeof(*AddressFile), TAG_ADDRESS_FILE); @@ -1053,8 +1011,6 @@ /* Initialize the datagram request stuff */ KeInitializeSpinLock(&AddressFile->RequestLock); InitializeListHead(&AddressFile->RequestListHead); - - DPRINT1("Protocol-dependent operations\n"); /* Give it an entity ID and open a PCB if needed. */ switch (Protocol) @@ -1106,8 +1062,6 @@ break; } } - - DPRINT1("Insert into address list\n"); /* Insert it into the list. */ InsertTailList(&AddressListHead, &AddressFile->ListEntry); @@ -1200,12 +1154,10 @@ { if (AddressFile->lwip_tcp_pcb->state == LISTEN) { - DPRINT1("Closing PCB at %p\n", AddressFile->lwip_tcp_pcb); lwip_err = tcp_close(AddressFile->lwip_tcp_pcb); } else { - DPRINT1("Aborting PCB at %p\n", AddressFile->lwip_tcp_pcb); tcp_arg(AddressFile->lwip_tcp_pcb, NULL); tcp_abort(AddressFile->lwip_tcp_pcb); lwip_err = ERR_OK; @@ -1227,7 +1179,7 @@ Status = STATUS_SUCCESS; break; default : - DPRINT1("Unknown protocol\n"); + DPRINT1("Unknown protocol. Something is seriously wrong.\n"); // Should never happen due to how callers are written. // This case is particularly bad since we don't know what needs // to be deallocated at all. @@ -1288,12 +1240,10 @@ } if (Context->TcpState == TCP_STATE_LISTENING) { - DPRINT1("Closing PCB at %p\n", Context->lwip_tcp_pcb); lwip_err = tcp_close(Context->lwip_tcp_pcb); } else { - DPRINT1("Aborting PCB at %p\n", Context->lwip_tcp_pcb); tcp_arg(Context->lwip_tcp_pcb, NULL); tcp_abort(Context->lwip_tcp_pcb); lwip_err = ERR_OK; @@ -1339,8 +1289,6 @@ if (AddressFile->ContextCount == 0) { - DPRINT1("Closing Address File at %p from TcpIpCloseContext on Context at %p\n", - AddressFile, Context); return TcpIpCloseAddress(AddressFile); } @@ -1445,7 +1393,6 @@ } Context = IrpSp->FileObject->FsContext; - DPRINT1("AddressFile at %08x\n", Context->AddressFile); if (Context->AddressFile->Protocol != IPPROTO_TCP) { DPRINT1("Received TDI_CONNECT for a non-TCP protocol\n"); @@ -1464,20 +1411,10 @@ SocketAddressRemote = (struct sockaddr *)&RemoteTransportAddress->Address[0]; SocketAddressInRemote = (struct sockaddr_in *)&SocketAddressRemote->sa_data; - DPRINT1("\n Remote Address\n Address: %08x\n Port: %04x\n", - SocketAddressInRemote->sin_addr.s_addr, - SocketAddressInRemote->sin_port); - DPRINT1("\n Local Address\n Address: %08x\n Port: %04x\n", - Context->lwip_tcp_pcb->local_ip, - Context->lwip_tcp_pcb->local_port); - - DPRINT1("Call into lwIP tcp_connect(). Context at %p, pcb at %p\n", - Context, Context->lwip_tcp_pcb); lwip_err = tcp_connect(Context->lwip_tcp_pcb, (ip_addr_t *)&SocketAddressInRemote->sin_addr.s_addr, SocketAddressInRemote->sin_port, lwip_tcp_connected_callback); - DPRINT1("Return from lwIP tcp_connect()\n"); switch (lwip_err) { case (ERR_VAL) : @@ -1614,18 +1551,11 @@ if (AddressFile->ContextListHead.Flink == &Context->ListEntry) { - DPRINT1("lwIP tcp_bind\n"); lwip_err = tcp_bind( Context->lwip_tcp_pcb, (ip_addr_t *)&AddressFile->Address.in_addr, AddressFile->Address.sin_port); ip_set_option(Context->lwip_tcp_pcb, SOF_BROADCAST); - DPRINT1("lwip error %d\n TCP PCB:\n Local Address: %08x\n Local Port: %04x\n Remote Address: %08x\n Remote Port: %04x\n", - lwip_err, - Context->lwip_tcp_pcb->local_ip, - Context->lwip_tcp_pcb->local_port, - Context->lwip_tcp_pcb->remote_ip, - Context->lwip_tcp_pcb->remote_port); if (lwip_err != ERR_OK) { switch (lwip_err) @@ -1650,7 +1580,6 @@ } case (ERR_OK) : { - DPRINT1("lwIP ERR_OK\n"); break; } default : @@ -1695,8 +1624,6 @@ Context = IrpSp->FileObject->FsContext; AddressFile = Context->AddressFile; - DPRINT1("AddressFile at %08x\n", AddressFile); - DPRINT1("Context at %08x\n", Context); if (AddressFile->Protocol != IPPROTO_TCP) { @@ -1723,16 +1650,12 @@ while (Entry != Head) { Request = CONTAINING_RECORD(Entry, TCP_REQUEST, ListEntry); - if (Request->PendingIrp) + Entry = Entry->Flink; + if (!Request->PendingIrp) { - IrpSp = IoGetCurrentIrpStackLocation(Request->PendingIrp); - DPRINT1("Pending IRP MonorFunction: %08x\n", IrpSp->MinorFunction); + RemoveEntryList(&Request->ListEntry); + ExFreePoolWithTag(Request, TAG_TCP_REQUEST); } - else - { - DPRINT1("IRP is NULL\n"); - } - Entry = Entry->Flink; } } KeReleaseSpinLock(&Context->RequestListLock, OldIrql); @@ -1776,7 +1699,6 @@ } AddressFile = Context->AddressFile; - DPRINT1("AddresFile at %08x\n", AddressFile); KeAcquireSpinLock(&AddressFile->ContextListLock, &OldIrql); if (AddressFile->ContextListHead.Flink == &Context->ListEntry) @@ -1848,10 +1770,6 @@ return STATUS_INVALID_PARAMETER; } NdisQueryBuffer(Irp->MdlAddress, &Buffer, &Len); - - DPRINT1("\n PTDI_REQUEST_KERNEL_SEND->SendLength = %d\n NDIS_BUFFER Length = %d\n", - Request->SendLength, - Len); if (!Context->lwip_tcp_pcb) { @@ -1927,8 +1845,6 @@ PTDI_REQUEST_KERNEL_RECEIVE RequestInfo; - DPRINT1("Receive IRP Address: %p\n", Irp); - IrpSp = IoGetCurrentIrpStackLocation(Irp); if (IrpSp->FileObject->FsContext2 != (PVOID)TDI_CONNECTION_FILE) @@ -1937,12 +1853,12 @@ return STATUS_INVALID_PARAMETER; } Context = IrpSp->FileObject->FsContext; - DPRINT1("Receive Context Address: %08x\n", Context); - DPRINT1("Receive Address File Address: %08x\n", Context->AddressFile); + //DPRINT1("Receive Context Address: %08x\n", Context); + //DPRINT1("Receive Address File Address: %08x\n", Context->AddressFile); if (Context->TcpState & (TCP_STATE_CONNECTED|TCP_STATE_ACCEPTED)) { RequestInfo = (PTDI_REQUEST_KERNEL_RECEIVE)&IrpSp->Parameters; - DPRINT1("\n Request Length = %d\n", RequestInfo->ReceiveLength); + //DPRINT1("\n Request Length = %d\n", RequestInfo->ReceiveLength); KeAcquireSpinLock(&Context->RequestListLock, &OldIrql); Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] Tue Jul 12 20:28:05 2016 @@ -417,6 +417,10 @@ Context = IrpSp->FileObject->FsContext; AddressFile = Context->AddressFile; break; + case TCP_REQUEST_STRUCT : + /* Deallocation already performed by the driver */ + Status = STATUS_SUCCESS; + goto FINISH; default : DPRINT1("Unknown FileObject type\n"); break; @@ -529,7 +533,8 @@ DPRINT1("TCPIP: Unknown internal IOCTL: 0x%x.\n", IrpSp->MinorFunction); Status = STATUS_NOT_IMPLEMENTED; } - + +FINISH: Irp->IoStatus.Status = Status; if (Status == STATUS_PENDING) {
8 years, 4 months
1
0
0
0
[jimtabor] 71907: [USER32_WINETEST] Sync with Wine Staging 1.9.11 Part 3. CORE-11368
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jul 12 20:08:44 2016 New Revision: 71907 URL:
http://svn.reactos.org/svn/reactos?rev=71907&view=rev
Log: [USER32_WINETEST] Sync with Wine Staging 1.9.11 Part 3. CORE-11368 Modified: trunk/rostests/winetests/user32/cursoricon.c trunk/rostests/winetests/user32/scroll.c trunk/rostests/winetests/user32/sysparams.c trunk/rostests/winetests/user32/text.c Modified: trunk/rostests/winetests/user32/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/cursoric…
============================================================================== --- trunk/rostests/winetests/user32/cursoricon.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/cursoricon.c [iso-8859-1] Tue Jul 12 20:08:44 2016 @@ -1130,14 +1130,76 @@ DeleteFileA(filename); } +typedef struct { + unsigned width; + unsigned height; + BOOL invalid_offset; +} test_icon_entries_t; + +static void create_ico_file(const char *filename, const test_icon_entries_t *test_icon_entries, unsigned entry_cnt) +{ + CURSORICONFILEDIRENTRY *icon_entry; + BITMAPINFOHEADER *icon_header; + CURSORICONFILEDIR *dir; + BYTE *buf, *bitmap_ptr; + DWORD bytes_written; + size_t icon_size; + HANDLE file; + unsigned i; + BOOL ret; + + const unsigned icon_bpp = 32; + + icon_size = FIELD_OFFSET(CURSORICONFILEDIR, idEntries[entry_cnt]) + sizeof(BITMAPINFOHEADER)*entry_cnt; + for(i=0; i<entry_cnt; i++) + icon_size += icon_bpp * test_icon_entries[i].width * test_icon_entries[i].height / 8; + + buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, icon_size); + dir = (CURSORICONFILEDIR*)buf; + + dir->idReserved = 0; + dir->idType = 1; + dir->idCount = entry_cnt; + + bitmap_ptr = buf + FIELD_OFFSET(CURSORICONFILEDIR, idEntries[entry_cnt]); + for(i=0; i<entry_cnt; i++) { + icon_entry = dir->idEntries+i; + icon_entry->bWidth = test_icon_entries[i].width; + icon_entry->bHeight = test_icon_entries[i].height; + icon_entry->bColorCount = 0; + icon_entry->bReserved = 0; + icon_entry->xHotspot = 1; + icon_entry->yHotspot = 1; + icon_entry->dwDIBSize = sizeof(BITMAPINFOHEADER) + icon_entry->bWidth * icon_entry->bHeight * icon_bpp / 8; + icon_entry->dwDIBOffset = test_icon_entries[i].invalid_offset ? 0xffffffff : bitmap_ptr - buf; + + icon_header = (BITMAPINFOHEADER*)bitmap_ptr; + bitmap_ptr += icon_entry->dwDIBSize; + + icon_header->biSize = sizeof(BITMAPINFOHEADER); + icon_header->biWidth = icon_entry->bWidth; + icon_header->biHeight = icon_entry->bHeight; + icon_header->biPlanes = 1; + icon_header->biBitCount = icon_bpp; + icon_header->biSizeImage = 0; /* Uncompressed bitmap. */ + } + + memset(bitmap_ptr, 0xf0, buf+icon_size-bitmap_ptr); + + /* Create the icon. */ + file = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed. %u\n", GetLastError()); + ret = WriteFile(file, buf, icon_size, &bytes_written, NULL); + ok(ret && bytes_written == icon_size, "icon.ico created improperly.\n"); + CloseHandle(file); +} + static void test_LoadImage(void) { HANDLE handle; BOOL ret; - DWORD error, bytes_written; - CURSORICONFILEDIR *icon_data; - CURSORICONFILEDIRENTRY *icon_entry; - BITMAPINFOHEADER *icon_header, *bitmap_header; + DWORD error; + BITMAPINFOHEADER *bitmap_header; ICONINFO icon_info; int i; @@ -1149,37 +1211,9 @@ (sizeof(CURSORICONFILEDIR) + sizeof(BITMAPINFOHEADER) \ + ICON_AND_SIZE + ICON_AND_SIZE*ICON_BPP) - /* Set icon data. */ - icon_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ICON_SIZE); - icon_data->idReserved = 0; - icon_data->idType = 1; - icon_data->idCount = 1; - - icon_entry = icon_data->idEntries; - icon_entry->bWidth = ICON_WIDTH; - icon_entry->bHeight = ICON_HEIGHT; - icon_entry->bColorCount = 0; - icon_entry->bReserved = 0; - icon_entry->xHotspot = 1; - icon_entry->yHotspot = 1; - icon_entry->dwDIBSize = ICON_SIZE - sizeof(CURSORICONFILEDIR); - icon_entry->dwDIBOffset = sizeof(CURSORICONFILEDIR); - - icon_header = (BITMAPINFOHEADER *) ((BYTE *) icon_data + icon_entry->dwDIBOffset); - icon_header->biSize = sizeof(BITMAPINFOHEADER); - icon_header->biWidth = ICON_WIDTH; - icon_header->biHeight = ICON_HEIGHT*2; - icon_header->biPlanes = 1; - icon_header->biBitCount = ICON_BPP; - icon_header->biSizeImage = 0; /* Uncompressed bitmap. */ - - /* Create the icon. */ - handle = CreateFileA("icon.ico", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, - FILE_ATTRIBUTE_NORMAL, NULL); - ok(handle != INVALID_HANDLE_VALUE, "CreateFileA failed. %u\n", GetLastError()); - ret = WriteFile(handle, icon_data, ICON_SIZE, &bytes_written, NULL); - ok(ret && bytes_written == ICON_SIZE, "icon.ico created improperly.\n"); - CloseHandle(handle); + static const test_icon_entries_t icon_desc = {32, 32}; + + create_ico_file("icon.ico", &icon_desc, 1); /* Test loading an icon as a cursor. */ SetLastError(0xdeadbeef); @@ -1227,7 +1261,6 @@ error = GetLastError(); ok(error == 0xdeadbeef, "Last error: %u\n", error); - HeapFree(GetProcessHeap(), 0, icon_data); DeleteFileA("icon.ico"); /* Test a system icon */ @@ -2484,6 +2517,140 @@ ok(cursor2 != cursor, "cursor == %p, cursor2 == %p\n", cursor, cursor2); } +static void test_PrivateExtractIcons(void) +{ + HICON icon; + UINT ret; + + static const test_icon_entries_t icon_desc[] = {{0,0,TRUE}, {16,16,TRUE}, {32,32}, {64,64,TRUE}}; + + create_ico_file("extract.ico", icon_desc, sizeof(icon_desc)/sizeof(*icon_desc)); + + ret = PrivateExtractIconsA("extract.ico", 0, 32, 32, &icon, NULL, 1, 0); + ok(ret == 1, "PrivateExtractIconsA returned %u\n", ret); + ok(icon != NULL, "icon == NULL\n"); + + test_icon_info(icon, 32, 32, 32, 32); + DestroyIcon(icon); + + DeleteFileA("extract.ico"); +} + +static void test_monochrome_icon(void) +{ + HANDLE handle; + BOOL ret; + DWORD bytes_written; + CURSORICONFILEDIR *icon_data; + CURSORICONFILEDIRENTRY *icon_entry; + BITMAPINFO *bitmap_info; + BITMAPCOREINFO *core_info; + ICONINFO icon_info; + ULONG icon_size; + BOOL monochrome, use_core_info; + + icon_data = HeapAlloc(GetProcessHeap(), 0, sizeof(CURSORICONFILEDIR) + sizeof(BITMAPINFOHEADER) + + 2 * sizeof(RGBQUAD) + sizeof(ULONG)); + + for (monochrome = FALSE; monochrome <= TRUE; monochrome++) + for (use_core_info = FALSE; use_core_info <= TRUE; use_core_info++) + { + trace("%s, %s\n", + monochrome ? "monochrome" : "colored", + use_core_info ? "core info" : "bitmap info"); + + icon_size = sizeof(CURSORICONFILEDIR) + + (use_core_info ? sizeof(BITMAPCOREHEADER) : sizeof(BITMAPINFOHEADER)) + + /* 2 * sizeof(RGBTRIPLE) + padding comes out the same */ + 2 * sizeof(RGBQUAD) + + sizeof(ULONG); + ZeroMemory(icon_data, icon_size); + icon_data->idReserved = 0; + icon_data->idType = 1; + icon_data->idCount = 1; + + icon_entry = icon_data->idEntries; + icon_entry->bWidth = 1; + icon_entry->bHeight = 1; + icon_entry->bColorCount = 0; + icon_entry->bReserved = 0; + icon_entry->xHotspot = 0; + icon_entry->yHotspot = 0; + icon_entry->dwDIBSize = icon_size - sizeof(CURSORICONFILEDIR); + icon_entry->dwDIBOffset = sizeof(CURSORICONFILEDIR); + + if (use_core_info) + { + core_info = (BITMAPCOREINFO *) ((BYTE *) icon_data + icon_entry->dwDIBOffset); + core_info->bmciHeader.bcSize = sizeof(BITMAPCOREHEADER); + core_info->bmciHeader.bcWidth = 1; + core_info->bmciHeader.bcHeight = 2; + core_info->bmciHeader.bcPlanes = 1; + core_info->bmciHeader.bcBitCount = 1; + core_info->bmciColors[0].rgbtBlue = monochrome ? 0x00 : 0xff; + core_info->bmciColors[0].rgbtGreen = 0x00; + core_info->bmciColors[0].rgbtRed = 0x00; + core_info->bmciColors[1].rgbtBlue = 0xff; + core_info->bmciColors[1].rgbtGreen = 0xff; + core_info->bmciColors[1].rgbtRed = 0xff; + } + else + { + bitmap_info = (BITMAPINFO *) ((BYTE *) icon_data + icon_entry->dwDIBOffset); + bitmap_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bitmap_info->bmiHeader.biWidth = 1; + bitmap_info->bmiHeader.biHeight = 2; + bitmap_info->bmiHeader.biPlanes = 1; + bitmap_info->bmiHeader.biBitCount = 1; + bitmap_info->bmiHeader.biSizeImage = 0; /* Uncompressed bitmap. */ + bitmap_info->bmiColors[0].rgbBlue = monochrome ? 0x00 : 0xff; + bitmap_info->bmiColors[0].rgbGreen = 0x00; + bitmap_info->bmiColors[0].rgbRed = 0x00; + bitmap_info->bmiColors[1].rgbBlue = 0xff; + bitmap_info->bmiColors[1].rgbGreen = 0xff; + bitmap_info->bmiColors[1].rgbRed = 0xff; + } + + handle = CreateFileA("icon.ico", GENERIC_WRITE, 0, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(handle != INVALID_HANDLE_VALUE, "CreateFileA failed. %u\n", GetLastError()); + ret = WriteFile(handle, icon_data, icon_size, &bytes_written, NULL); + ok(ret && bytes_written == icon_size, "icon.ico created improperly.\n"); + CloseHandle(handle); + + handle = LoadImageA(NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE); + ok(handle != NULL, "LoadImage() failed with %u.\n", GetLastError()); + if (handle == NULL) + { + skip("Icon failed to load: %s, %s\n", + monochrome ? "monochrome" : "colored", + use_core_info ? "core info" : "bitmap info"); + DeleteFileA("icon.ico"); + continue; + } + + ret = GetIconInfo(handle, &icon_info); + ok(ret, "GetIconInfo() failed with %u.\n", GetLastError()); + if (ret) + { + ok(icon_info.fIcon == TRUE, "fIcon is %u.\n", icon_info.fIcon); + ok(icon_info.xHotspot == 0, "xHotspot is %u.\n", icon_info.xHotspot); + ok(icon_info.yHotspot == 0, "yHotspot is %u.\n", icon_info.yHotspot); + if (monochrome) + ok(icon_info.hbmColor == NULL, "Got hbmColor %p!\n", icon_info.hbmColor); + else + ok(icon_info.hbmColor != NULL, "No hbmColor!\n"); + ok(icon_info.hbmMask != NULL, "No hbmMask!\n"); + } + + ret = DestroyIcon(handle); + ok(ret, "DestroyIcon() failed with %u.\n", GetLastError()); + DeleteFileA("icon.ico"); + } + + HeapFree(GetProcessHeap(), 0, icon_data); +} + START_TEST(cursoricon) { pGetCursorInfo = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetCursorInfo" ); @@ -2522,6 +2689,8 @@ test_SetCursor(); test_ShowCursor(); test_DestroyCursor(); + test_PrivateExtractIcons(); + test_monochrome_icon(); do_parent(); test_child_process(); finish_child_process(); Modified: trunk/rostests/winetests/user32/scroll.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/scroll.c…
============================================================================== --- trunk/rostests/winetests/user32/scroll.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/scroll.c [iso-8859-1] Tue Jul 12 20:08:44 2016 @@ -113,6 +113,15 @@ ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH ); ok( ret, "The scrollbar should be enabled.\n" ); ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" ); + + /* disable window, try to re-enable */ + ret = EnableWindow( hScroll, FALSE ); + ok( !ret, "got %d\n", ret ); + ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" ); + + ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH ); + ok( ret, "got %d\n", ret ); + ok( IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" ); DestroyWindow(hScroll); DestroyWindow(mainwnd); @@ -539,7 +548,7 @@ EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH); ret = IsWindowEnabled(hScroll); - ok(!ret, "scroll bar disabled\n"); + ok(!ret, "scroll bar enabled\n"); memset(&si, 0, sizeof(si)); si.cbSize = sizeof(si); @@ -551,9 +560,10 @@ memset(&si, 0, sizeof(si)); si.cbSize = sizeof(si); ret = IsWindowEnabled(hScroll); - ok(!ret, "scroll bar disabled\n"); + ok(!ret, "scroll bar enabled\n"); si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; si.nMax = 100; + si.nMin = 10; si.nPos = 0; si.nPage = 100; SetScrollInfo(hScroll, SB_CTL, &si, TRUE); @@ -563,6 +573,18 @@ si.fMask = 0xf; ret = GetScrollInfo(hScroll, SB_CTL, &si); ok(ret, "got %d\n", ret); + + EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH); + ok(IsWindowEnabled(hScroll), "expected enabled scrollbar\n"); + + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 10; + si.nMin = 100; + si.nPos = 0; + si.nPage = 100; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); + ok(ret, "scroll bar disabled\n"); DestroyWindow(hScroll); DestroyWindow(mainwnd); Modified: trunk/rostests/winetests/user32/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/sysparam…
============================================================================== --- trunk/rostests/winetests/user32/sysparams.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/sysparams.c [iso-8859-1] Tue Jul 12 20:08:44 2016 @@ -1836,10 +1836,7 @@ * Changing the work area by just one pixel should make this occurrence * reasonably unlikely. */ - curr_val.left = old_area.left; - curr_val.top = old_area.top; - curr_val.right = old_area.right-1; - curr_val.bottom = old_area.bottom-1; + SetRect(&curr_val, old_area.left, old_area.top, old_area.right - 1, old_area.bottom - 1); rc=SystemParametersInfoA( SPI_SETWORKAREA, 0, &curr_val, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); if (!test_error_msg(rc,"SPI_SETWORKAREA")) return; Modified: trunk/rostests/winetests/user32/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/text.c?r…
============================================================================== --- trunk/rostests/winetests/user32/text.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/text.c [iso-8859-1] Tue Jul 12 20:08:44 2016 @@ -2,7 +2,7 @@ * DrawText tests * * Copyright (c) 2004 Zach Gorman - * Copyright 2007 Dmitry Timoshkov + * Copyright 2007,2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -44,8 +44,9 @@ static WCHAR emptystringW[] = { 0 }; static CHAR wordbreak_text[] = "line1 line2"; static WCHAR wordbreak_textW[] = {'l','i','n','e','1',' ','l','i','n','e','2',0}; + static char tabstring[] = "one\ttwo"; INT textlen, textheight, heightcheck; - RECT rect = { 0, 0, 100, 0 }; + RECT rect = { 0, 0, 100, 0 }, rect2; BOOL ret; DRAWTEXTPARAMS dtp; BOOL conform_xp = TRUE; @@ -315,16 +316,16 @@ dtp.cbSize = sizeof(dtp); dtp.iLeftMargin = 0; dtp.iRightMargin = 0; - SetRect( &rect, 0, 0, 0, 0); + SetRectEmpty(&rect); DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp); textlen = rect.right; /* Width without margin */ dtp.iLeftMargin = 8; - SetRect( &rect, 0, 0, 0, 0); + SetRectEmpty(&rect); DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp); ok(rect.right==dtp.iLeftMargin+textlen ,"Incorrect left margin calculated rc(%d,%d)\n", rect.left, rect.right); dtp.iLeftMargin = 0; dtp.iRightMargin = 8; - SetRect( &rect, 0, 0, 0, 0); + SetRectEmpty(&rect); DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp); ok(rect.right==dtp.iRightMargin+textlen ,"Incorrect right margin calculated rc(%d,%d)\n", rect.left, rect.right); @@ -535,7 +536,7 @@ } /* More test cases from bug 12226 */ - SetRect(&rect, 0, 0, 0, 0); + SetRectEmpty(&rect); textheight = DrawTextA(hdc, emptystring, -1, &rect, DT_CALCRECT | DT_LEFT | DT_SINGLELINE); ok(textheight, "DrawTextA error %u\n", GetLastError()); ok(0 == rect.left, "expected 0, got %d\n", rect.left); @@ -543,7 +544,7 @@ ok(0 == rect.top, "expected 0, got %d\n", rect.top); ok(rect.bottom, "rect.bottom should not be 0\n"); - SetRect(&rect, 0, 0, 0, 0); + SetRectEmpty(&rect); textheight = DrawTextW(hdc, emptystringW, -1, &rect, DT_CALCRECT | DT_LEFT | DT_SINGLELINE); if (!textheight && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { @@ -579,6 +580,42 @@ textheight = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT | DT_WORDBREAK | DT_EDITCONTROL); ok(textheight >= heightcheck * 6, "Got unexpected textheight %d, expected at least %d.\n", textheight, heightcheck * 6); + + /* DT_TABSTOP | DT_EXPANDTABS tests */ + SetRect( &rect, 0,0, 10, 10); + textheight = DrawTextA(hdc, tabstring, -1, &rect, DT_TABSTOP | DT_EXPANDTABS ); + ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight); + + SetRect( &rect, 0,0, 10, 10); + memset(&dtp, 0, sizeof(dtp)); + dtp.cbSize = sizeof(dtp); + textheight = DrawTextExA(hdc, tabstring, -1, &rect, DT_CALCRECT, &dtp); + ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight); + ok(dtp.iTabLength == 0, "invalid dtp.iTabLength = %i\n",dtp.iTabLength); + + SetRect( &rect2, 0,0, 10, 10); + memset(&dtp, 0, sizeof(dtp)); + dtp.cbSize = sizeof(dtp); + textheight = DrawTextExA(hdc, tabstring, -1, &rect2, DT_CALCRECT | DT_TABSTOP | DT_EXPANDTABS, &dtp); + ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight); + ok(dtp.iTabLength == 0, "invalid dtp.iTabLength = %i\n",dtp.iTabLength); + ok(rect.left == rect2.left && rect.right != rect2.right && rect.top == rect2.top && rect.bottom == rect2.bottom, + "incorrect rect %d,%d-%d,%d rect2 %d,%d-%d,%d\n", + rect.left, rect.top, rect.right, rect.bottom, rect2.left, rect2.top, rect2.right, rect2.bottom ); + + SetRect( &rect, 0,0, 10, 10); + memset(&dtp, 0, sizeof(dtp)); + dtp.cbSize = sizeof(dtp); + dtp.iTabLength = 8; + textheight = DrawTextExA(hdc, tabstring, -1, &rect, DT_CALCRECT | DT_TABSTOP | DT_EXPANDTABS, &dtp); + ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight); + ok(dtp.iTabLength == 8, "invalid dtp.iTabLength = %i\n",dtp.iTabLength); + ok(rect.left == rect2.left, "unexpected value %d, got %d\n", rect.left, rect2.left); + /* XP, 2003 appear to not give the same values. */ + ok(rect.right == rect2.right || broken(rect.right > rect2.right), "unexpected value %d, got %d\n",rect.right, rect2.right); + ok(rect.top == rect2.top, "unexpected value %d, got %d\n", rect.top, rect2.top); + ok(rect.bottom == rect2.bottom , "unexpected value %d, got %d\n", rect.bottom, rect2.bottom); + SelectObject(hdc, hOldFont); ret = DeleteObject(hFont); @@ -722,9 +759,44 @@ DestroyWindow(hwnd); } +static void test_string_conversions(void) +{ + char buf[64] = "string"; + int i; + BOOL ret; + struct + { + char *src, *dst; + unsigned len; + BOOL ret; + } test[] = + { + { NULL, NULL, 1, FALSE }, + { buf, NULL, 1, FALSE }, + { NULL, buf, 1, FALSE }, + { buf, buf, 1, TRUE } + }; + + for (i = 0; i < sizeof(test)/sizeof(test[0]); i++) + { + ret = CharToOemA(test[i].src, test[i].dst); + ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret); + + ret = CharToOemBuffA(test[i].src, test[i].dst, test[i].len); + ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret); + + ret = OemToCharA(test[i].src, test[i].dst); + ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret); + + ret = OemToCharBuffA(test[i].src, test[i].dst, test[i].len); + ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret); + } +} + START_TEST(text) { test_TabbedText(); test_DrawTextCalcRect(); test_DrawState(); + test_string_conversions(); }
8 years, 4 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
36
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
Results per page:
10
25
50
100
200