Author: tkreuzer
Date: Sun May 11 16:49:56 2008
New Revision: 33452
URL:
http://svn.reactos.org/svn/reactos?rev=33452&view=rev
Log:
- a bunch of tests for NtUserEnumDisplaySettings
- one test for NtGdiGetFontResourceInfoInternalW
Added:
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiGetFontResourceInfoInternalW.c (with
props)
trunk/rostests/apitests/w32knapi/ntuser/NtUserEnumDisplaySettings.c (with props)
Modified:
trunk/rostests/apitests/w32knapi/testlist.c
trunk/rostests/apitests/w32knapi/w32knapi.rbuild
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiGetFontResourceInfoInternalW.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiGetFontResourceInfoInternalW.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiGetFontResourceInfoInternalW.c
[iso-8859-1] Sun May 11 16:49:56 2008
@@ -1,0 +1,43 @@
+
+INT
+Test_NtGdiGetFontResourceInfoInternalW(PTESTINFO pti)
+{
+ WCHAR szFullFileName[MAX_PATH+1];
+ BOOL bRet;
+ DWORD dwBufSize;
+ LOGFONTW logfont;
+ UNICODE_STRING NtFileName;
+
+ GetCurrentDirectoryW(MAX_PATH, szFullFileName);
+ wcscat(szFullFileName, L"\\test.otf");
+
+ ASSERT(AddFontResourceW(szFullFileName) != 0);
+
+ ASSERT(RtlDosPathNameToNtPathName_U(szFullFileName,
+ &NtFileName,
+ NULL,
+ NULL));
+
+ dwBufSize = sizeof(logfont);
+ memset(&logfont, 0x0, dwBufSize);
+
+ bRet = NtGdiGetFontResourceInfoInternalW(
+ NtFileName.Buffer,
+ (NtFileName.Length / sizeof(WCHAR)) +1,
+ 1,
+ dwBufSize,
+ &dwBufSize,
+ &logfont,
+ 2);
+
+ TEST(bRet != FALSE);
+
+ printf("lfHeight = %ld\n", logfont.lfHeight);
+ printf("lfWidth = %ld\n", logfont.lfWidth);
+ printf("lfFaceName = %ls\n", logfont.lfFaceName);
+
+ RemoveFontResourceW(szFullFileName);
+
+ return APISTATUS_NORMAL;
+}
+
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiGetFontResourceInfoInternalW.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/w32knapi/ntuser/NtUserEnumDisplaySettings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserEnumDisplaySettings.c (added)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserEnumDisplaySettings.c [iso-8859-1] Sun
May 11 16:49:56 2008
@@ -1,0 +1,99 @@
+
+static struct
+{
+ DEVMODEW devmode;
+ CHAR buffer[0xffff];
+} data;
+
+INT
+TEST_NtUserEnumDisplaySettings(PTESTINFO pti)
+{
+ UNICODE_STRING usDeviceName;
+ WCHAR szName[] = L"DISPLAY";
+ NTSTATUS Status;
+ INT i;
+
+ SetLastError(ERROR_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 0, 0, 0);
+ TEST(Status == STATUS_ACCESS_VIOLATION);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ data.devmode.dmDriverExtra = 0;
+ for (i = 0; i < 2 * sizeof(DEVMODEW); i++)
+ {
+ data.devmode.dmSize = i;
+ Status = NtUserEnumDisplaySettings(NULL, 1000, (DEVMODEW*)&data, 0);
+ if (i != sizeof(DEVMODEW))
+ {
+ TEST(Status == STATUS_BUFFER_TOO_SMALL);
+ }
+ }
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ usDeviceName.Buffer = NULL;
+ usDeviceName.Length = 0;
+ usDeviceName.MaximumLength = 0;
+ Status = NtUserEnumDisplaySettings(&usDeviceName, ENUM_CURRENT_SETTINGS,
(DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_BUFFER_TOO_SMALL);
+ Status = NtUserEnumDisplaySettings(&usDeviceName, -4, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_BUFFER_TOO_SMALL);
+
+ data.devmode.dmSize = sizeof(DEVMODEW);
+ data.devmode.dmDriverExtra = 0xffff;
+ Status = NtUserEnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, (DEVMODEW*)&data,
0);
+ TEST(Status == STATUS_SUCCESS);
+
+ data.devmode.dmSize = sizeof(DEVMODEW);
+ data.devmode.dmDriverExtra = 0;
+ Status = NtUserEnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, (DEVMODEW*)&data,
0);
+ TEST(Status == STATUS_SUCCESS);
+
+ usDeviceName.Buffer = NULL;
+ usDeviceName.Length = 0;
+ usDeviceName.MaximumLength = 0;
+ Status = NtUserEnumDisplaySettings(&usDeviceName, ENUM_CURRENT_SETTINGS,
(DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_1);
+ Status = NtUserEnumDisplaySettings(&usDeviceName, -4, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_1);
+
+ Status = NtUserEnumDisplaySettings(NULL, 0, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 1, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 2, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 4, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 8, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+
+ Status = NtUserEnumDisplaySettings(NULL, 247, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, 248, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_2);
+
+ Status = NtUserEnumDisplaySettings(NULL, -1, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, -2, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, -3, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_SUCCESS);
+ Status = NtUserEnumDisplaySettings(NULL, -4, (DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_2);
+
+ Status = NtUserEnumDisplaySettings(&usDeviceName, ENUM_CURRENT_SETTINGS,
(DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_1);
+
+ usDeviceName.Buffer = szName;
+ usDeviceName.Length = wcslen(szName);
+ usDeviceName.MaximumLength = usDeviceName.Length;
+ Status = NtUserEnumDisplaySettings(&usDeviceName, ENUM_CURRENT_SETTINGS,
(DEVMODEW*)&data, 0);
+ TEST(Status == STATUS_INVALID_PARAMETER_1);
+
+ Status = NtUserEnumDisplaySettings(&usDeviceName, 1000, (DEVMODEW*)&data,
123456);
+ TEST(Status == STATUS_INVALID_PARAMETER_1);
+
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ return APISTATUS_NORMAL;
+}
Propchange: trunk/rostests/apitests/w32knapi/ntuser/NtUserEnumDisplaySettings.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/w32knapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/testlis…
==============================================================================
--- trunk/rostests/apitests/w32knapi/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/testlist.c [iso-8859-1] Sun May 11 16:49:56 2008
@@ -15,6 +15,7 @@
//#include "ntgdi/NtGdiEnumFontChunk.c"
#include "ntgdi/NtGdiEnumFontOpen.c"
#include "ntgdi/NtGdiGetBitmapBits.c"
+#include "ntgdi/NtGdiGetFontResourceInfoInternalW.c"
#include "ntgdi/NtGdiGetRandomRgn.c"
#include "ntgdi/NtGdiSelectBitmap.c"
#include "ntgdi/NtGdiSelectBrush.c"
@@ -34,6 +35,7 @@
#include "ntuser/NtUserCallOneParam.c"
#include "ntuser/NtUserCountClipboardFormats.c"
//#include "ntuser/NtUserCreateWindowEx.c"
+#include "ntuser/NtUserEnumDisplaySettings.c"
#include "ntuser/NtUserFindExistingCursorIcon.c"
#include "ntuser/NtUserRedrawWindow.c"
#include "ntuser/NtUserScrollDC.c"
@@ -51,13 +53,14 @@
/* ntgdi */
{ L"NtGdiArcInternal", Test_NtGdiArcInternal },
{ L"NtGdiBitBlt", Test_NtGdiBitBlt },
-{ L"NtGdiCreateBitmap", Test_NtGdiCreateBitmap },
+ { L"NtGdiCreateBitmap", Test_NtGdiCreateBitmap },
{ L"NtGdiCreateCompatibleBitmap", Test_NtGdiCreateCompatibleBitmap },
{ L"NtGdiDoPalette", Test_NtGdiDoPalette },
{ L"NtGdiEngCreatePalette", Test_NtGdiEngCreatePalette },
// { L"NtGdiEnumFontChunk", Test_NtGdiEnumFontChunk },
{ L"NtGdiEnumFontOpen", Test_NtGdiEnumFontOpen },
{ L"NtGdiGetBitmapBits", Test_NtGdiGetBitmapBits },
+ { L"NtGdiGetFontResourceInfoInternalW", Test_NtGdiGetFontResourceInfoInternalW
},
{ L"NtGdiGetRandomRgn", Test_NtGdiGetRandomRgn },
{ L"NtGdiSetBitmapBits", Test_NtGdiSetBitmapBits },
{ L"NtGdiSelectBitmap", Test_NtGdiSelectBitmap },
@@ -78,6 +81,7 @@
{ L"NtUserCallOneParam", Test_NtUserCallOneParam },
{ L"NtUserCountClipboardFormats", Test_NtUserCountClipboardFormats },
// { L"NtUserCreateWindowEx", Test_NtUserCreateWindowEx },
+ { L"NtUserEnumDisplaySettings", TEST_NtUserEnumDisplaySettings },
{ L"NtUserFindExistingCursorIcon", Test_NtUserFindExistingCursoricon },
{ L"NtUserRedrawWindow", Test_NtUserRedrawWindow },
{ L"NtUserScrollDC", Test_NtUserScrollDC },
Modified: trunk/rostests/apitests/w32knapi/w32knapi.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/w32knap…
==============================================================================
--- trunk/rostests/apitests/w32knapi/w32knapi.rbuild [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/w32knapi.rbuild [iso-8859-1] Sun May 11 16:49:56
2008
@@ -4,6 +4,7 @@
<define name="_WIN32_WINNT">0x0501</define>
<define name="WINVER">0x501</define>
<library>apitest</library>
+ <library>ntdll</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>