Author: fireball
Date: Wed May 24 00:05:14 2006
New Revision: 21992
URL:
http://svn.reactos.ru/svn/reactos?rev=21992&view=rev
Log:
Update ntdll_winetest to Wine-23052006
Modified:
trunk/reactos/regtests/winetests/ntdll/atom.c
trunk/reactos/regtests/winetests/ntdll/error.c
trunk/reactos/regtests/winetests/ntdll/info.c
trunk/reactos/regtests/winetests/ntdll/large_int.c
trunk/reactos/regtests/winetests/ntdll/om.c
trunk/reactos/regtests/winetests/ntdll/path.c
trunk/reactos/regtests/winetests/ntdll/reg.c
trunk/reactos/regtests/winetests/ntdll/rtl.c
trunk/reactos/regtests/winetests/ntdll/rtlstr.c
trunk/reactos/regtests/winetests/ntdll/time.c
Modified: trunk/reactos/regtests/winetests/ntdll/atom.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/at…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/atom.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/atom.c Wed May 24 00:05:14 2006
@@ -21,16 +21,27 @@
* windows.
*/
-#define _WIN32_WINNT 0x0501
-
#include <stdio.h>
#include <stdarg.h>
+
#include "ntstatus.h"
+/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro
+ * definition errors when we get to winnt.h
+ */
#define WIN32_NO_STATUS
-#include "windows.h"
+
+#include "windef.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "winnls.h"
#include "wine/test.h"
#include "wine/unicode.h"
#include "winternl.h"
+
+#ifndef __WINE_WINTERNL_H
+typedef unsigned short RTL_ATOM, *PRTL_ATOM;
+typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
+#endif
/* Function pointers for ntdll calls */
static HMODULE hntdll = 0;
@@ -43,6 +54,9 @@
static NTSTATUS (WINAPI *pRtlPinAtomInAtomTable)(RTL_ATOM_TABLE,RTL_ATOM);
static NTSTATUS (WINAPI
*pRtlQueryAtomInAtomTable)(RTL_ATOM_TABLE,RTL_ATOM,PULONG,PULONG,PWSTR,PULONG);
+static NTSTATUS (WINAPI* pNtAddAtom)(LPCWSTR,ULONG,RTL_ATOM*);
+static NTSTATUS (WINAPI* pNtQueryInformationAtom)(RTL_ATOM,DWORD,void*,ULONG,PULONG);
+
static const WCHAR EmptyAtom[] = {0};
static const WCHAR testAtom1[] =
{'H','e','l','l','o','
','W','o','r','l','d',0};
static const WCHAR testAtom2[] =
{'H','e','l','l','o','
','W','o','r','l','d','2',0};
@@ -70,6 +84,9 @@
pRtlLookupAtomInAtomTable = (void *)GetProcAddress(hntdll,
"RtlLookupAtomInAtomTable");
pRtlPinAtomInAtomTable = (void *)GetProcAddress(hntdll,
"RtlPinAtomInAtomTable");
pRtlQueryAtomInAtomTable = (void *)GetProcAddress(hntdll,
"RtlQueryAtomInAtomTable");
+
+ pNtAddAtom = (void *)GetProcAddress(hntdll, "NtAddAtom");
+ pNtQueryInformationAtom = (void *)GetProcAddress(hntdll,
"NtQueryInformationAtom");
}
}
@@ -181,6 +198,24 @@
ok(!strcmpW(Name, testAtom2), "We found wrong atom\n");
ok((strlenW(testAtom2) * sizeof(WCHAR)) == Len, "Returned wrong length
%ld\n", Len);
+ Len = 8;
+ Name[0] = Name[1] = Name[2] = Name[3] = Name[4] = 0x55AA;
+ res = pRtlQueryAtomInAtomTable(AtomTable, Atom2, NULL, NULL, Name, &Len);
+ ok(!res, "query atom %lx\n", res);
+ ok(Len == 6, "wrong length %lu\n", Len);
+ ok(!memcmp(Name, testAtom2, Len), "wrong atom string\n");
+ ok(!Name[3], "wrong string termination\n");
+ ok(Name[4] == 0x55AA, "buffer overwrite\n");
+
+ Len = lstrlenW(testAtom2) * sizeof(WCHAR);
+ memset(Name, '.', sizeof(Name));
+ res = pRtlQueryAtomInAtomTable( AtomTable, Atom2, NULL, NULL, Name, &Len );
+ ok(!res, "query atom %lx\n", res);
+ ok(Len == (lstrlenW(testAtom2) - 1) * sizeof(WCHAR), "wrong length
%lu\n", Len);
+ ok(!memcmp(testAtom2, Name, (lstrlenW(testAtom2) - 1) * sizeof(WCHAR)),
"wrong atom name\n");
+ ok(Name[lstrlenW(testAtom2) - 1] == '\0', "wrong char\n");
+ ok(Name[lstrlenW(testAtom2)] == ('.' << 8) + '.',
"wrong char\n");
+
res = pRtlLookupAtomInAtomTable(AtomTable, testAtom2, &testAtom);
ok(!res, "We can't find our pinned atom!! retval: %lx\n", res);
ok(testAtom == Atom2, "We found wrong atom!!!\n");
@@ -233,19 +268,6 @@
res = pRtlQueryAtomInAtomTable(AtomTable, Atom1, NULL, NULL, Name, &Len);
ok(res == STATUS_BUFFER_TOO_SMALL, "Got wrong retval, retval: %lx\n",
res);
ok((strlenW(testAtom1) * sizeof(WCHAR)) == Len, "Got wrong length
%lx\n", Len);
-
- res = pRtlQueryAtomInAtomTable(AtomTable, Atom1, NULL, NULL, NULL, &Len);
- ok(!res, "Failed to retrieve atom length, retval: %lx\n", res);
- ok(Len == strlenW(testAtom1) * sizeof(WCHAR), "Invalid atom length got %lu
expected %u\n",
- Len, strlenW(testAtom1) * sizeof(WCHAR));
-
- Len = strlenW(testAtom1) * sizeof(WCHAR);
- Name[strlenW(testAtom1)] = '*';
- res = pRtlQueryAtomInAtomTable(AtomTable, Atom1, NULL, NULL, Name, &Len);
- ok(!res, "Failed with exactly long enough buffer, retval: %lx\n",
res);
- ok(Name[strlenW(testAtom1)] == '*', "Writing outside
buffer\n");
- ok(0 == memcmp(Name, testAtom1, (strlenW(testAtom1) - 1) * sizeof(WCHAR)),
- "We found wrong atom!!\n");
res = pRtlPinAtomInAtomTable(AtomTable, Atom1);
ok(!res, "Unable to pin atom in atom table, retval: %lx\n", res);
@@ -404,6 +426,47 @@
}
}
+static void test_Global(void)
+{
+ NTSTATUS res;
+ RTL_ATOM atom;
+ char ptr[sizeof(ATOM_BASIC_INFORMATION) + 255 * sizeof(WCHAR)];
+ ATOM_BASIC_INFORMATION* abi = (ATOM_BASIC_INFORMATION*)ptr;
+ ULONG ptr_size = sizeof(ATOM_BASIC_INFORMATION) + 255 * sizeof(WCHAR);
+
+ res = pNtAddAtom(testAtom1, lstrlenW(testAtom1) * sizeof(WCHAR), &atom);
+ ok(!res, "Added atom (%lx)\n", res);
+
+ memset(abi->Name, 0x55, 255 * sizeof(WCHAR));
+ res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
+ ok(!res, "atom lookup\n");
+ ok(!lstrcmpW(abi->Name, testAtom1), "ok strings\n");
+ ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR), "wrong string
length\n");
+ ok(abi->Name[lstrlenW(testAtom1)] == 0, "wrong string termination %x\n",
abi->Name[lstrlenW(testAtom1)]);
+ ok(abi->Name[lstrlenW(testAtom1) + 1] == 0x5555, "buffer overwrite
%x\n", abi->Name[lstrlenW(testAtom1) + 1]);
+
+ ptr_size = sizeof(ATOM_BASIC_INFORMATION);
+ res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
+ ok(res == STATUS_BUFFER_TOO_SMALL, "wrong return status (%lx)\n", res);
+ ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR), "ok string
length\n");
+
+ memset(abi->Name, 0x55, lstrlenW(testAtom1) * sizeof(WCHAR));
+ ptr_size = sizeof(ATOM_BASIC_INFORMATION) + lstrlenW(testAtom1) * sizeof(WCHAR);
+ res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
+ ok(!res, "atom lookup %lx\n", res);
+ ok(!lstrcmpW(abi->Name, testAtom1), "strings don't match\n");
+ ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR), "wrong string
length\n");
+ ok(abi->Name[lstrlenW(testAtom1)] == 0, "buffer overwrite %x\n",
abi->Name[lstrlenW(testAtom1)]);
+ ok(abi->Name[lstrlenW(testAtom1) + 1] == 0x5555, "buffer overwrite
%x\n", abi->Name[lstrlenW(testAtom1) + 1]);
+
+ ptr_size = sizeof(ATOM_BASIC_INFORMATION) + 4 * sizeof(WCHAR);
+ abi->Name[0] = abi->Name[1] = abi->Name[2] = abi->Name[3] =
'\0';
+ res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL
);
+ ok(!res, "couldn't find atom\n");
+ ok(abi->NameLength == 8, "wrong string length %u\n",
abi->NameLength);
+ ok(!memcmp(abi->Name, testAtom1, 8), "strings don't match\n");
+}
+
START_TEST(atom)
{
InitFunctionPtr();
@@ -412,5 +475,6 @@
test_NtAtom();
test_NtIntAtom();
test_NtRefPinAtom();
- }
-}
+ test_Global();
+ }
+}
Modified: trunk/reactos/regtests/winetests/ntdll/error.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/er…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/error.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/error.c Wed May 24 00:05:14 2006
@@ -18,8 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _WIN32_WINNT 0x0501
-
#include <stdarg.h>
#include <stdio.h>
@@ -27,8 +25,6 @@
#define WIN32_NO_STATUS
#include "wine/test.h"
-
-#include "windows.h"
#include "windef.h"
#include "winbase.h"
Modified: trunk/reactos/regtests/winetests/ntdll/info.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/in…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/info.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/info.c Wed May 24 00:05:14 2006
@@ -216,7 +216,7 @@
DWORD status;
DWORD last_pid;
ULONG ReturnLength;
- int i = 0, j = 0, k = 0;
+ int i = 0, k = 0;
int is_nt = 0;
SYSTEM_BASIC_INFORMATION sbi;
@@ -297,6 +297,7 @@
if (!is_nt)
{
+ DWORD j;
for ( j = 0; j < spi->dwThreadCount; j++)
{
k++;
@@ -362,8 +363,7 @@
{
DWORD status;
ULONG ReturnLength;
- DWORD ModuleCount;
- int i;
+ ULONG ModuleCount, i;
ULONG SystemInformationLength = sizeof(SYSTEM_MODULE_INFORMATION);
SYSTEM_MODULE_INFORMATION* smi = HeapAlloc(GetProcessHeap(), 0,
SystemInformationLength);
@@ -389,7 +389,7 @@
/* Loop through all the modules/drivers, Wine doesn't get here (yet) */
for (i = 0; i < ModuleCount ; i++)
{
- ok( i == sm->Id, "Id (%d) should have matched %d\n", sm->Id, i);
+ ok( i == sm->Id, "Id (%d) should have matched %lu\n", sm->Id,
i);
sm++;
}
Modified: trunk/reactos/regtests/winetests/ntdll/large_int.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/la…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/large_int.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/large_int.c Wed May 24 00:05:14 2006
@@ -391,22 +391,22 @@
result = pRtlLargeIntegerToChar(&value, 20, largeint2str[0].MaximumLength,
NULL);
ok(result == STATUS_INVALID_PARAMETER,
"(test a): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx,
expected: %lx\n",
- largeint2str[0].value, 20, largeint2str[0].MaximumLength, result, (DWORD)
STATUS_INVALID_PARAMETER);
+ largeint2str[0].value, 20, largeint2str[0].MaximumLength, result,
STATUS_INVALID_PARAMETER);
result = pRtlLargeIntegerToChar(&value, 20, 0, NULL);
ok(result == STATUS_INVALID_PARAMETER,
"(test b): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx,
expected: %lx\n",
- largeint2str[0].value, 20, largeint2str[0].MaximumLength, result, (DWORD)
STATUS_INVALID_PARAMETER);
+ largeint2str[0].value, 20, largeint2str[0].MaximumLength, result,
STATUS_INVALID_PARAMETER);
result = pRtlLargeIntegerToChar(&value, largeint2str[0].base, 0, NULL);
ok(result == STATUS_BUFFER_OVERFLOW,
"(test c): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx,
expected: %lx\n",
- largeint2str[0].value, largeint2str[0].base, 0, result, (DWORD)
STATUS_BUFFER_OVERFLOW);
+ largeint2str[0].value, largeint2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW);
result = pRtlLargeIntegerToChar(&value, largeint2str[0].base,
largeint2str[0].MaximumLength, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
"(test d): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx,
expected: %lx\n",
- largeint2str[0].value, largeint2str[0].base, largeint2str[0].MaximumLength,
result, (DWORD) STATUS_ACCESS_VIOLATION);
+ largeint2str[0].value, largeint2str[0].base, largeint2str[0].MaximumLength,
result, STATUS_ACCESS_VIOLATION);
}
Modified: trunk/reactos/regtests/winetests/ntdll/om.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/om…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/om.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/om.c Wed May 24 00:05:14 2006
@@ -90,7 +90,7 @@
attr.Attributes = 0;
status = pNtCreateMutant(&Mutant, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND,
+ ok(status == STATUS_OBJECT_PATH_NOT_FOUND,
"NtCreateMutant should have failed with STATUS_OBJECT_PATH_NOT_FOUND
got(%08lx)\n", status);
pNtClose(Event);
@@ -126,7 +126,7 @@
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtCreateNamedPipeFile(&pipe, GENERIC_READ|GENERIC_WRITE, &attr,
&iosb, FILE_SHARE_READ|FILE_SHARE_WRITE,
FILE_CREATE, FILE_PIPE_FULL_DUPLEX, FALSE, FALSE,
FALSE, 1, 256, 256, &timeout);
- todo_wine ok(status == STATUS_INSTANCE_NOT_AVAILABLE,
+ ok(status == STATUS_INSTANCE_NOT_AVAILABLE,
"NtCreateNamedPipeFile should have failed with STATUS_INSTANCE_NOT_AVAILABLE
got(%08lx)\n", status);
attr.Attributes = OBJ_CASE_INSENSITIVE;
@@ -137,7 +137,7 @@
pRtlInitUnicodeString(&str, buffer3);
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtOpenFile(&h, GENERIC_READ, &attr, &iosb,
FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN);
- todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND || status ==
STATUS_PIPE_NOT_AVAILABLE,
+ ok(status == STATUS_OBJECT_PATH_NOT_FOUND || status == STATUS_PIPE_NOT_AVAILABLE,
"pNtOpenFile should have failed with STATUS_OBJECT_PATH_NOT_FOUND
got(%08lx)\n", status);
pRtlInitUnicodeString(&str, buffer4);
@@ -185,21 +185,19 @@
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
pRtlCreateUnicodeStringFromAsciiz(&str, "\\");
- h = 0;
- todo_wine{ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_NAME_COLLISION) }
- ok(h == 0, "Failed create returned valid handle! (%p)\n", h);
+ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_NAME_COLLISION)
InitializeObjectAttributes(&attr, &str, OBJ_OPENIF, 0, NULL);
- todo_wine{ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_NAME_EXISTS) }
+ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_NAME_EXISTS)
pNtClose(h);
status = pNtCreateMutant(&h, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_TYPE_MISMATCH,
+ ok(status == STATUS_OBJECT_TYPE_MISMATCH,
"NtCreateMutant should have failed with STATUS_OBJECT_TYPE_MISMATCH
got(%08lx)\n", status);
pRtlFreeUnicodeString(&str);
pRtlCreateUnicodeStringFromAsciiz(&str, "\\??\\PIPE\\om.c-mutant");
status = pNtCreateMutant(&h, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_TYPE_MISMATCH,
+ ok(status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_OBJECT_PATH_NOT_FOUND,
"NtCreateMutant should have failed with STATUS_OBJECT_TYPE_MISMATCH
got(%08lx)\n", status);
pRtlFreeUnicodeString(&str);
@@ -289,22 +287,22 @@
/* No name and/or no attributes */
status = pNtCreateDirectoryObject(NULL, DIRECTORY_QUERY, &attr);
- todo_wine ok(status == STATUS_ACCESS_VIOLATION,
+ ok(status == STATUS_ACCESS_VIOLATION,
"NtCreateDirectoryObject should have failed with STATUS_ACCESS_VIOLATION
got(%08lx)\n", status);
status = pNtOpenDirectoryObject(NULL, DIRECTORY_QUERY, &attr);
- todo_wine ok(status == STATUS_ACCESS_VIOLATION,
+ ok(status == STATUS_ACCESS_VIOLATION,
"NtOpenDirectoryObject should have failed with STATUS_ACCESS_VIOLATION
got(%08lx)\n", status);
status = pNtCreateDirectoryObject(&h, DIRECTORY_QUERY, NULL);
ok(status == STATUS_SUCCESS, "Failed to create Directory without
attributes(%08lx)\n", status);
pNtClose(h);
status = pNtOpenDirectoryObject(&h, DIRECTORY_QUERY, NULL);
- todo_wine ok(status == STATUS_INVALID_PARAMETER,
+ ok(status == STATUS_INVALID_PARAMETER,
"NtOpenDirectoryObject should have failed with STATUS_INVALID_PARAMETER
got(%08lx)\n", status);
InitializeObjectAttributes(&attr, NULL, 0, 0, NULL);
DIR_TEST_CREATE_SUCCESS(&dir)
- todo_wine{ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD) }
+ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
/* Bad name */
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
@@ -312,15 +310,15 @@
pRtlCreateUnicodeStringFromAsciiz(&str, "");
DIR_TEST_CREATE_SUCCESS(&h)
pNtClose(h);
- todo_wine{ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD) }
- pRtlFreeUnicodeString(&str);
- pNtClose(dir);
-
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "BaseNamedObjects",
STATUS_OBJECT_PATH_SYNTAX_BAD) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\",
STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\\\BaseNamedObjects",
STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h,
"\\BaseNamedObjects\\\\om.c-test", STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h,
"\\BaseNamedObjects\\om.c-test\\", STATUS_OBJECT_PATH_NOT_FOUND) }
+ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
+ pRtlFreeUnicodeString(&str);
+ pNtClose(dir);
+
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "BaseNamedObjects",
STATUS_OBJECT_PATH_SYNTAX_BAD)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\",
STATUS_OBJECT_NAME_INVALID)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\\\BaseNamedObjects",
STATUS_OBJECT_NAME_INVALID)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\\\om.c-test",
STATUS_OBJECT_NAME_INVALID)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\om.c-test\\",
STATUS_OBJECT_PATH_NOT_FOUND)
pRtlCreateUnicodeStringFromAsciiz(&str,
"\\BaseNamedObjects\\om.c-test");
DIR_TEST_CREATE_SUCCESS(&h)
@@ -336,11 +334,11 @@
pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Local");
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtOpenSymbolicLinkObject(&dir, SYMBOLIC_LINK_QUERY, &attr);\
- todo_wine ok(status == STATUS_SUCCESS, "Failed to open
SymbolicLink(%08lx)\n", status);
+ ok(status == STATUS_SUCCESS, "Failed to open SymbolicLink(%08lx)\n",
status);
pRtlFreeUnicodeString(&str);
InitializeObjectAttributes(&attr, &str, 0, dir, NULL);
pRtlCreateUnicodeStringFromAsciiz(&str, "one more level");
- todo_wine{ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_TYPE_MISMATCH) }
+ DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_TYPE_MISMATCH)
pRtlFreeUnicodeString(&str);
pNtClose(h);
pNtClose(dir);
@@ -351,14 +349,14 @@
pRtlFreeUnicodeString(&str);
InitializeObjectAttributes(&attr, NULL, 0, dir, NULL);
- todo_wine{ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_NAME_INVALID) }
+ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_NAME_INVALID)
InitializeObjectAttributes(&attr, &str, 0, dir, NULL);
DIR_TEST_CREATE_OPEN_SUCCESS(&h, "")
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\",
STATUS_OBJECT_PATH_SYNTAX_BAD) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\om.c-test",
STATUS_OBJECT_PATH_SYNTAX_BAD) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\om.c-test\\",
STATUS_OBJECT_PATH_SYNTAX_BAD) }
- todo_wine{ DIR_TEST_CREATE_OPEN_FAILURE(&h, "om.c-test\\",
STATUS_OBJECT_PATH_NOT_FOUND) }
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\", STATUS_OBJECT_PATH_SYNTAX_BAD)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\om.c-test",
STATUS_OBJECT_PATH_SYNTAX_BAD)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "\\om.c-test\\",
STATUS_OBJECT_PATH_SYNTAX_BAD)
+ DIR_TEST_CREATE_OPEN_FAILURE(&h, "om.c-test\\",
STATUS_OBJECT_PATH_NOT_FOUND)
pRtlCreateUnicodeStringFromAsciiz(&str, "om.c-test");
DIR_TEST_CREATE_SUCCESS(&dir1)
@@ -374,7 +372,7 @@
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
DIR_TEST_OPEN_SUCCESS(&dir)
InitializeObjectAttributes(&attr, &str, 0, dir, NULL);
- todo_wine{ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD) }
+ DIR_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
pRtlFreeUnicodeString(&str);
pNtClose(dir);
@@ -422,18 +420,18 @@
/* Test inavalid paths */
pRtlCreateUnicodeStringFromAsciiz(&str, "\\om.c-mutant");
status = pNtCreateMutant(&h, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD,
+ ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD,
"NtCreateMutant should have failed with STATUS_OBJECT_PATH_SYNTAX_BAD
got(%08lx)\n", status);
pRtlFreeUnicodeString(&str);
pRtlCreateUnicodeStringFromAsciiz(&str, "\\om.c-mutant\\");
status = pNtCreateMutant(&h, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD,
+ ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD,
"NtCreateMutant should have failed with STATUS_OBJECT_PATH_SYNTAX_BAD
got(%08lx)\n", status);
pRtlFreeUnicodeString(&str);
pRtlCreateUnicodeStringFromAsciiz(&str, "om.c\\-mutant");
status = pNtCreateMutant(&h, GENERIC_ALL, &attr, FALSE);
- todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND,
+ ok(status == STATUS_OBJECT_PATH_NOT_FOUND,
"NtCreateMutant should have failed with STATUS_OBJECT_PATH_NOT_FOUND
got(%08lx)\n", status);
pRtlFreeUnicodeString(&str);
@@ -476,18 +474,18 @@
IO_STATUS_BLOCK iosb;
/* No name and/or no attributes */
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(NULL, "", "",
STATUS_ACCESS_VIOLATION) }
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(NULL, "", "",
STATUS_ACCESS_VIOLATION)
status = pNtCreateSymbolicLinkObject(&h, SYMBOLIC_LINK_QUERY, NULL, NULL);
- todo_wine ok(status == STATUS_ACCESS_VIOLATION,
+ ok(status == STATUS_ACCESS_VIOLATION,
"NtCreateSymbolicLinkObject should have failed with STATUS_ACCESS_VIOLATION
got(%08lx)\n", status);
status = pNtOpenSymbolicLinkObject(&h, SYMBOLIC_LINK_QUERY, NULL);
- todo_wine ok(status == STATUS_INVALID_PARAMETER,
+ ok(status == STATUS_INVALID_PARAMETER,
"NtOpenSymbolicLinkObject should have failed with STATUS_INVALID_PARAMETER
got(%08lx)\n", status);
InitializeObjectAttributes(&attr, NULL, 0, 0, NULL);
- todo_wine{ SYMLNK_TEST_CREATE_FAILURE(&link, STATUS_INVALID_PARAMETER) }
- todo_wine{ SYMLNK_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD) }
+ SYMLNK_TEST_CREATE_FAILURE(&link, STATUS_INVALID_PARAMETER)
+ SYMLNK_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
/* Bad name */
pRtlCreateUnicodeStringFromAsciiz(&target, "anywhere");
@@ -495,7 +493,7 @@
pRtlCreateUnicodeStringFromAsciiz(&str, "");
SYMLNK_TEST_CREATE_SUCCESS(&link)
- todo_wine{ SYMLNK_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD) }
+ SYMLNK_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
pNtClose(link);
pRtlFreeUnicodeString(&str);
@@ -504,11 +502,11 @@
pRtlFreeUnicodeString(&str);
pRtlFreeUnicodeString(&target);
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "BaseNamedObjects",
"->Somewhere", STATUS_OBJECT_PATH_SYNTAX_BAD) }
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\",
"->Somewhere", STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\\\BaseNamedObjects",
"->Somewhere", STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h,
"\\BaseNamedObjects\\\\om.c-test", "->Somewhere",
STATUS_OBJECT_NAME_INVALID) }
- todo_wine{ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h,
"\\BaseNamedObjects\\om.c-test\\", "->Somewhere",
STATUS_OBJECT_NAME_INVALID) }
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "BaseNamedObjects",
"->Somewhere", STATUS_OBJECT_PATH_SYNTAX_BAD)
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\",
"->Somewhere", STATUS_OBJECT_NAME_INVALID)
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\\\BaseNamedObjects",
"->Somewhere", STATUS_OBJECT_NAME_INVALID)
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\\\om.c-test",
"->Somewhere", STATUS_OBJECT_NAME_INVALID)
+ SYMLNK_TEST_CREATE_OPEN_FAILURE(&h, "\\BaseNamedObjects\\om.c-test\\",
"->Somewhere", STATUS_OBJECT_NAME_INVALID)
/* Compaund test */
Modified: trunk/reactos/regtests/winetests/ntdll/path.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/pa…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/path.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/path.c Wed May 24 00:05:14 2006
@@ -266,12 +266,12 @@
pRtlMultiByteToUnicodeN(pathbufW , sizeof(pathbufW), NULL, test->path,
strlen(test->path)+1 );
ret = pRtlGetFullPathName_U( pathbufW,MAX_PATH, rbufferW, &file_part);
ok( ret == len, "Wrong result %ld/%d for \"%s\"\n", ret, len,
test->path );
- ok(pRtlUnicodeToMultiByteN(rbufferA,MAX_PATH,&reslen,rbufferW,MAX_PATH) ==
STATUS_SUCCESS,
+
ok(pRtlUnicodeToMultiByteN(rbufferA,MAX_PATH,&reslen,rbufferW,(lstrlenW(rbufferW) + 1)
* sizeof(WCHAR)) == STATUS_SUCCESS,
"RtlUnicodeToMultiByteN failed\n");
ok(lstrcmpiA(rbufferA,test->rname) == 0, "Got \"%s\" expected
\"%s\"\n",rbufferA,test->rname);
if (file_part)
{
- ok(pRtlUnicodeToMultiByteN(rfileA,MAX_PATH,&reslen,file_part,MAX_PATH) ==
STATUS_SUCCESS,
+
ok(pRtlUnicodeToMultiByteN(rfileA,MAX_PATH,&reslen,file_part,(lstrlenW(file_part) + 1)
* sizeof(WCHAR)) == STATUS_SUCCESS,
"RtlUnicodeToMultiByteN failed\n");
ok(test->rfile && !lstrcmpiA(rfileA,test->rfile), "Got
\"%s\" expected \"%s\"\n",rfileA,test->rfile);
}
Modified: trunk/reactos/regtests/winetests/ntdll/reg.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/re…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/reg.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/reg.c Wed May 24 00:05:14 2006
@@ -24,12 +24,10 @@
#include "ntdll_test.h"
#include "winternl.h"
-//#include "wine/library.h"
#include "stdio.h"
#include "winnt.h"
#include "winnls.h"
#include "stdlib.h"
-#include "wine/unicode.h"
#ifndef __WINE_WINTERNL_H
@@ -68,6 +66,16 @@
PVOID DefaultData;
ULONG DefaultLength;
} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
+
+#define InitializeObjectAttributes(p,n,a,r,s) \
+ do { \
+ (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
+ (p)->RootDirectory = r; \
+ (p)->Attributes = a; \
+ (p)->ObjectName = n; \
+ (p)->SecurityDescriptor = s; \
+ (p)->SecurityQualityOfService = NULL; \
+ } while (0)
#endif
@@ -151,7 +159,7 @@
if(ValueName)
{
- ValueNameLength = strlenW(ValueName);
+ ValueNameLength = lstrlenW(ValueName);
ValName = (LPSTR)pRtlAllocateHeap(GetProcessHeap(), 0, ValueNameLength);
@@ -286,7 +294,6 @@
{
/*Create WineTest*/
OBJECT_ATTRIBUTES attr;
- UNICODE_STRING ValName;
HKEY key;
ACCESS_MASK am = GENERIC_ALL;
NTSTATUS status;
@@ -295,7 +302,6 @@
status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0);
ok(status == STATUS_SUCCESS, "NtCreateKey Failed: 0x%08lx\n", status);
- pRtlFreeUnicodeString(&ValName);
pNtClose(&key);
}
Modified: trunk/reactos/regtests/winetests/ntdll/rtl.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/rt…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/rtl.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/rtl.c Wed May 24 00:05:14 2006
@@ -24,6 +24,26 @@
#include <stdlib.h>
#include "ntdll_test.h"
+
+#ifndef __WINE_WINTERNL_H
+
+typedef struct _RTL_HANDLE
+{
+ struct _RTL_HANDLE * Next;
+} RTL_HANDLE;
+
+typedef struct _RTL_HANDLE_TABLE
+{
+ ULONG MaxHandleCount;
+ ULONG HandleSize;
+ ULONG Unused[2];
+ PVOID NextFree;
+ PVOID FirstHandle;
+ PVOID ReservedMemory;
+ PVOID MaxHandle;
+} RTL_HANDLE_TABLE;
+
+#endif
/* Function ptrs for ntdll calls */
static HMODULE hntdll = 0;
@@ -44,6 +64,8 @@
static NTSTATUS (WINAPI * pRtlDestroyHandleTable)(RTL_HANDLE_TABLE *);
static RTL_HANDLE * (WINAPI * pRtlAllocateHandle)(RTL_HANDLE_TABLE *, ULONG *);
static BOOLEAN (WINAPI * pRtlFreeHandle)(RTL_HANDLE_TABLE *, RTL_HANDLE *);
+static NTSTATUS (WINAPI
*pRtlAllocateAndInitializeSid)(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID*);
+static NTSTATUS (WINAPI *pRtlFreeSid)(PSID);
#define LEN 16
static const char* src_src = "This is a test!"; /* 16 bytes long, incl NUL */
static ULONG src_aligned_block[4];
@@ -73,6 +95,8 @@
pRtlDestroyHandleTable = (void *)GetProcAddress(hntdll,
"RtlDestroyHandleTable");
pRtlAllocateHandle = (void *)GetProcAddress(hntdll, "RtlAllocateHandle");
pRtlFreeHandle = (void *)GetProcAddress(hntdll, "RtlFreeHandle");
+ pRtlAllocateAndInitializeSid = (void *)GetProcAddress(hntdll,
"RtlAllocateAndInitializeSid");
+ pRtlFreeSid = (void *)GetProcAddress(hntdll, "RtlFreeSid");
}
strcpy((char*)src_aligned_block, src_src);
ok(strlen(src) == 15, "Source must be 16 bytes long!\n");
@@ -820,7 +844,7 @@
if (!pRtlComputeCrc32)
return;
- crc = pRtlComputeCrc32(crc, src, LEN);
+ crc = pRtlComputeCrc32(crc, (LPBYTE)src, LEN);
ok(crc == 0x40861dc2,"Expected 0x40861dc2, got %8lx\n", crc);
}
@@ -856,6 +880,25 @@
ok(result, "Couldn't free handle %p\n", MyHandle);
status = pRtlDestroyHandleTable(&HandleTable);
ok(status == STATUS_SUCCESS, "RtlDestroyHandleTable failed with error
0x%08lx\n", status);
+}
+
+static void test_RtlAllocateAndInitializeSid(void)
+{
+ NTSTATUS ret;
+ SID_IDENTIFIER_AUTHORITY sia = {{ 1, 2, 3, 4, 5, 6 }};
+ PSID psid;
+
+ ret = pRtlAllocateAndInitializeSid(&sia, 0, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
+ ok(!ret, "RtlAllocateAndInitializeSid error %08lx\n", ret);
+ ret = pRtlFreeSid(psid);
+ ok(!ret, "RtlFreeSid error %08lx\n", ret);
+
+ /* these tests crash on XP
+ ret = pRtlAllocateAndInitializeSid(NULL, 0, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
+ ret = pRtlAllocateAndInitializeSid(&sia, 0, 1, 2, 3, 4, 5, 6, 7, 8, NULL);*/
+
+ ret = pRtlAllocateAndInitializeSid(&sia, 9, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
+ ok(ret == STATUS_INVALID_SID, "wrong error %08lx\n", ret);
}
START_TEST(rtl)
@@ -888,4 +931,6 @@
test_RtlComputeCrc32();
if (pRtlInitializeHandleTable)
test_HandleTables();
-}
+ if (pRtlAllocateAndInitializeSid)
+ test_RtlAllocateAndInitializeSid();
+}
Modified: trunk/reactos/regtests/winetests/ntdll/rtlstr.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/rt…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/rtlstr.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/rtlstr.c Wed May 24 00:05:14 2006
@@ -199,8 +199,8 @@
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, teststring);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
- result, (DWORD) STATUS_SUCCESS);
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
+ result);
ok(uni.Length == 32,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected
%u\n",
uni.Length, 32);
@@ -231,7 +231,7 @@
result = pRtlInitUnicodeStringEx(&uni, teststring2);
ok(result == STATUS_NAME_TOO_LONG,
"pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
- result, (DWORD) STATUS_NAME_TOO_LONG);
+ result, STATUS_NAME_TOO_LONG);
ok(uni.Length == 12345,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected
%u\n",
uni.Length, 12345);
@@ -263,8 +263,8 @@
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, 0);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
- result, (DWORD) STATUS_SUCCESS);
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
+ result);
ok(uni.Length == 0,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected
%u\n",
uni.Length, 0);
@@ -1651,22 +1651,22 @@
result = pRtlIntegerToChar(int2str[0].value, 20, int2str[0].MaximumLength, NULL);
ok(result == STATUS_INVALID_PARAMETER,
"(test a): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected:
%lx\n",
- int2str[0].value, 20, int2str[0].MaximumLength, result, (DWORD)
STATUS_INVALID_PARAMETER);
+ int2str[0].value, 20, int2str[0].MaximumLength, result,
STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, 20, 0, NULL);
ok(result == STATUS_INVALID_PARAMETER,
"(test b): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected:
%lx\n",
- int2str[0].value, 20, 0, result, (DWORD) STATUS_INVALID_PARAMETER);
+ int2str[0].value, 20, 0, result, STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base, 0, NULL);
ok(result == STATUS_BUFFER_OVERFLOW,
"(test c): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected:
%lx\n",
- int2str[0].value, int2str[0].base, 0, result, (DWORD) STATUS_BUFFER_OVERFLOW);
+ int2str[0].value, int2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base,
int2str[0].MaximumLength, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
"(test d): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected:
%lx\n",
- int2str[0].value, int2str[0].base, int2str[0].MaximumLength, result, (DWORD)
STATUS_ACCESS_VIOLATION);
+ int2str[0].value, int2str[0].base, int2str[0].MaximumLength, result,
STATUS_ACCESS_VIOLATION);
}
static const WCHAR szGuid[] = {
'{','0','1','0','2','0','3','0','4','-',
Modified: trunk/reactos/regtests/winetests/ntdll/time.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/ti…
==============================================================================
--- trunk/reactos/regtests/winetests/ntdll/time.c (original)
+++ trunk/reactos/regtests/winetests/ntdll/time.c Wed May 24 00:05:14 2006
@@ -43,7 +43,7 @@
/* start time of the tests */
TIME_FIELDS tftest = {1889,12,31,23,59,59,0,0};
-static void test_pRtlTimeToTimeFields()
+static void test_pRtlTimeToTimeFields(void)
{
LARGE_INTEGER litime , liresult;
TIME_FIELDS tfresult;