Prepare win32k for tests
authorCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 18 Jun 2005 06:17:10 +0000 (06:17 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 18 Jun 2005 06:17:10 +0000 (06:17 +0000)
svn path=/trunk/; revision=16022

14 files changed:
reactos/lib/kernel32/tests/kernel32.xml
reactos/lib/kernel32/tests/stubs.tst [deleted file]
reactos/lib/kernel32/tests/stubs.xml
reactos/lib/kernel32/tests/tests/CreateFile.c
reactos/regtests/regtests/regtests.c
reactos/regtests/regtests/regtests.def
reactos/regtests/shared/regtests.c
reactos/regtests/shared/regtests.h
reactos/subsys/win32k/tests/stubs.tst [deleted file]
reactos/subsys/win32k/tests/stubs.xml [new file with mode: 0644]
reactos/subsys/win32k/tests/win32k.xml [new file with mode: 0644]
reactos/subsys/win32k/win32k.xml
reactos/tools/rbuild/rbuild.h
reactos/tools/rbuild/testsupportcode.cpp

index 052b373..ee11bb2 100644 (file)
@@ -1,8 +1,10 @@
 <module name="kernel32_test" type="test">\r
        <include base="rtshared">.</include>\r
-       <define name="__USE_W32API" />\r
        <define name="_DISABLE_TIDENTS" />\r
        <define name="_SEH_NO_NATIVE_NLG" />\r
+       <define name="__USE_W32API" />\r
+       <define name="_WIN32_WINNT">0x0502</define>\r
+       <define name="__NO_CTYPE_INLINES" />\r
        <define name="WINVER">0x0500</define>\r
        <library>rtshared</library>\r
        <library>regtests</library>\r
diff --git a/reactos/lib/kernel32/tests/stubs.tst b/reactos/lib/kernel32/tests/stubs.tst
deleted file mode 100644 (file)
index 66bd45d..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-ntdll.dll  CsrCaptureParameterBuffer@16
-ntdll.dll  CsrClientCallServer@16
-ntdll.dll  CsrClientConnectToServer@0
-ntdll.dll  CsrReleaseParameterBuffer@4
-ntdll.dll  DbgUiContinue@8
-ntdll.dll  HeapAlloc@12=RtlAllocateHeap
-ntdll.dll  HeapFree@12=RtlFreeHeap
-ntdll.dll  LdrAccessResource@16
-ntdll.dll  LdrDisableThreadCalloutsForDll@4
-ntdll.dll  LdrFindResource_U@16
-ntdll.dll  LdrLoadDll@16
-ntdll.dll  LdrShutdownProcess@0
-ntdll.dll  LdrShutdownThread@0
-ntdll.dll  LdrUnloadDll@4
-ntdll.dll  NtAllocateVirtualMemory@24
-ntdll.dll  NtClose@4
-ntdll.dll  NtCreateDirectoryObject@12
-ntdll.dll  NtCreateEvent@20
-ntdll.dll  NtCreateFile@44
-ntdll.dll  NtCreateKey@28
-ntdll.dll  NtCreateProcess@32
-ntdll.dll  NtCreateSection@28
-ntdll.dll  NtDelayExecution@8
-ntdll.dll  NtDeviceIoControlFile@40
-ntdll.dll  _imp__NtDuplicateObject@28
-ntdll.dll  NtFlushBuffersFile@8
-ntdll.dll  NtFlushInstructionCache@12
-ntdll.dll  NtFlushVirtualMemory@16
-ntdll.dll  NtFreeVirtualMemory@16
-ntdll.dll  NtFsControlFile@40
-ntdll.dll  NtGetContextThread@8
-ntdll.dll  NtLockVirtualMemory@16
-ntdll.dll  NtOpenDirectoryObject@12
-ntdll.dll  NtOpenEvent@12
-ntdll.dll  NtOpenFile@24
-ntdll.dll  NtOpenKey@12
-ntdll.dll  NtOpenProcess@16
-ntdll.dll  NtOpenSection@12
-ntdll.dll  NtOpenThread@16
-ntdll.dll  NtProtectVirtualMemory@20
-ntdll.dll  NtPulseEvent@8
-ntdll.dll  NtQueryDefaultLocale@8
-ntdll.dll  NtQueryDefaultUILanguage@4
-ntdll.dll  NtQueryDirectoryFile@44
-ntdll.dll  NtQueryInformationFile@20
-ntdll.dll  _imp__NtQueryInformationProcess@20
-ntdll.dll  NtQueryInformationThread@20
-ntdll.dll  NtQueryObject@20
-ntdll.dll  NtQuerySystemInformation@16
-ntdll.dll  NtQuerySystemTime@4
-ntdll.dll  NtQueryValueKey@24
-ntdll.dll  NtQueryVirtualMemory@24
-ntdll.dll  NtQueryVolumeInformationFile@20
-ntdll.dll  NtReadFile@36
-ntdll.dll  NtReadVirtualMemory@20
-ntdll.dll  NtResetEvent@8
-ntdll.dll  NtResumeThread@8
-ntdll.dll  NtSetContextThread@8
-ntdll.dll  NtSetEvent@8
-ntdll.dll  NtSetInformationFile@20
-ntdll.dll  NtSetInformationObject@16
-ntdll.dll  _imp__NtSetInformationProcess@16
-ntdll.dll  NtSetInformationThread@16
-ntdll.dll  NtSetSystemInformation@12
-ntdll.dll  NtSetSystemTime@8
-ntdll.dll  NtSignalAndWaitForSingleObject@16
-ntdll.dll  NtSuspendThread@8
-ntdll.dll  NtTerminateThread@8
-ntdll.dll  NtUnlockVirtualMemory@16
-ntdll.dll  NtUnmapViewOfSection@8
-ntdll.dll  NtWaitForMultipleObjects@20
-ntdll.dll  NtWaitForSingleObject@12
-ntdll.dll  NtWriteFile@36
-ntdll.dll  NtWriteVirtualMemory@20
-ntdll.dll  NtYieldExecution@0
-ntdll.dll  RtlAcquirePebLock@0
-ntdll.dll  RtlAnsiStringToUnicodeSize@4
-ntdll.dll  _imp__RtlBaseProcessStartRoutine
-ntdll.dll  RtlCompactHeap@8
-ntdll.dll  RtlCopyUnicodeString@8
-ntdll.dll  RtlCreateHeap@24
-ntdll.dll  RtlCreateProcessParameters@40
-ntdll.dll  RtlCreateUnicodeString@8
-ntdll.dll  RtlCreateUnicodeStringFromAsciiz@8
-ntdll.dll  RtlDeleteCriticalSection@4
-ntdll.dll  RtlDestroyHeap@4
-ntdll.dll  RtlDestroyProcessParameters@4
-ntdll.dll  RtlDoesFileExists_U@4
-ntdll.dll  RtlDosPathNameToNtPathName_U@16
-ntdll.dll  RtlDosSearchPath_U@24
-ntdll.dll  RtlEnterCriticalSection@4
-ntdll.dll  RtlExpandEnvironmentStrings_U@16
-ntdll.dll  RtlFreeHeap@12
-ntdll.dll  RtlGetCurrentDirectory_U@8
-ntdll.dll  RtlGetFullPathName_U@16
-ntdll.dll  RtlGetProcessHeaps@8
-ntdll.dll  RtlImageNtHeader@4
-ntdll.dll  RtlInitCodePageTable@8
-ntdll.dll  RtlInitializeCriticalSection@4
-ntdll.dll  RtlInitUnicodeString@8
-ntdll.dll  RtlIntegerToChar@16
-ntdll.dll  RtlIntegerToUnicodeString@12
-ntdll.dll  RtlIsNameLegalDOS8Dot3@12
-ntdll.dll  RtlLeaveCriticalSection@4
-ntdll.dll  RtlLockHeap@4
-ntdll.dll  RtlNtStatusToDosError@4
-ntdll.dll  RtlOemStringToUnicodeSize@4
-ntdll.dll  RtlOemStringToUnicodeString@12
-ntdll.dll  RtlOpenCurrentUser@8
-ntdll.dll  RtlQueryEnvironmentVariable_U@12
-ntdll.dll  RtlRaiseException@4
-ntdll.dll  RtlReAllocateHeap@16
-ntdll.dll  RtlReleasePebLock@0
-ntdll.dll  RtlRosCreateUserThreadVa
-ntdll.dll  RtlRosExitUserThread@4
-ntdll.dll  RtlSetCurrentDirectory_U@4
-ntdll.dll  RtlSetEnvironmentVariable@12
-ntdll.dll  RtlSetTimeZoneInformation@4
-ntdll.dll  RtlTimeFieldsToTime@8
-ntdll.dll  RtlTimeToTimeFields@8
-ntdll.dll  RtlUnicodeStringToAnsiSize@4
-ntdll.dll  RtlUnicodeStringToAnsiString@12
-ntdll.dll  RtlUnicodeStringToInteger@12
-ntdll.dll  RtlUnicodeStringToOemString@12
-ntdll.dll  RtlUnicodeToOemN@20
-ntdll.dll  RtlUnlockHeap@4
-ntdll.dll  RtlValidateHeap@12
-ntdll.dll  ZwMapViewOfSection@40
-ntdll.dll  ZwOpenSection@12
-ntdll.dll  ZwQuerySection@20
-ntdll.dll  ZwQuerySystemInformation@16
-ntdll.dll  ZwReadFile@36
-ntdll.dll  ZwTerminateProcess@8
index 03088d4..e32202b 100644 (file)
@@ -23,7 +23,7 @@
        <symbol>NtCreateSection@28</symbol>\r
        <symbol>NtDelayExecution@8</symbol>\r
        <symbol>NtDeviceIoControlFile@40</symbol>\r
-       <symbol>_imp__NtDuplicateObject@28</symbol>\r
+       <symbol>NtDuplicateObject@28</symbol>\r
        <symbol>NtFlushBuffersFile@8</symbol>\r
        <symbol>NtFlushInstructionCache@12</symbol>\r
        <symbol>NtFlushVirtualMemory@16</symbol>\r
@@ -44,7 +44,7 @@
        <symbol>NtQueryDefaultUILanguage@4</symbol>\r
        <symbol>NtQueryDirectoryFile@44</symbol>\r
        <symbol>NtQueryInformationFile@20</symbol>\r
-       <symbol>_imp__NtQueryInformationProcess@20</symbol>\r
+       <symbol>NtQueryInformationProcess@20</symbol>\r
        <symbol>NtQueryInformationThread@20</symbol>\r
        <symbol>NtQueryObject@20</symbol>\r
        <symbol>NtQuerySystemInformation@16</symbol>\r
@@ -60,7 +60,7 @@
        <symbol>NtSetEvent@8</symbol>\r
        <symbol>NtSetInformationFile@20</symbol>\r
        <symbol>NtSetInformationObject@16</symbol>\r
-       <symbol>_imp__NtSetInformationProcess@16</symbol>\r
+       <symbol>NtSetInformationProcess@16</symbol>\r
        <symbol>NtSetInformationThread@16</symbol>\r
        <symbol>NtSetSystemInformation@12</symbol>\r
        <symbol>NtSetSystemTime@8</symbol>\r
@@ -76,7 +76,7 @@
        <symbol>NtYieldExecution@0</symbol>\r
        <symbol>RtlAcquirePebLock@0</symbol>\r
        <symbol>RtlAnsiStringToUnicodeSize@4</symbol>\r
-       <symbol>_imp__RtlBaseProcessStartRoutine</symbol>\r
+       <symbol>RtlBaseProcessStartRoutine</symbol>\r
        <symbol>RtlCompactHeap@8</symbol>\r
        <symbol>RtlCopyUnicodeString@8</symbol>\r
        <symbol>RtlCreateHeap@24</symbol>\r
index efbe9dc..4dc153d 100644 (file)
@@ -90,7 +90,7 @@ MockNtCreateFile(PHANDLE FileHandle,
   return STATUS_SUCCESS;
 }
 
-static HOOK NtCreateFileHooks[] =
+static _HOOK NtCreateFileHooks[] =
 {
   {"NtCreateFile", MockNtCreateFile},
   {NULL, NULL}
index 9fcc8d2..b904be1 100755 (executable)
@@ -86,3 +86,15 @@ _SetThreadPriority(HANDLE hThread, int nPriority)
 {
   return SetThreadPriority(hThread, nPriority);
 }
+
+HANDLE STDCALL
+_GetCurrentProcess()
+{
+  return GetCurrentProcess();
+}
+
+HANDLE STDCALL
+_GetCurrentThread()
+{
+  return GetCurrentThread();
+}
index 7a792a5..166d550 100644 (file)
@@ -12,3 +12,5 @@ _CloseHandle@4
 _GetThreadTimes@20
 _SetPriorityClass@8
 _SetThreadPriority@8
+_GetCurrentProcess@0
+_GetCurrentThread@0
index 553c523..9c142a6 100755 (executable)
@@ -22,7 +22,7 @@
 typedef struct _PERFORM_TEST_ARGS
 {
   TestOutputRoutine OutputRoutine;
-  PROS_TEST Test;
+  _PTEST Test;
   LPSTR TestName;
 } PERFORM_TEST_ARGS;
 
@@ -53,7 +53,7 @@ PerformTest(PVOID _arg)
 {
   PERFORM_TEST_ARGS *Args = (PERFORM_TEST_ARGS *)_arg;
   TestOutputRoutine OutputRoutine = Args->OutputRoutine;
-  PROS_TEST Test = Args->Test;
+  _PTEST Test = Args->Test;
   LPSTR TestName = Args->TestName;
   HANDLE hThread;
   FILETIME time;
@@ -62,7 +62,7 @@ PerformTest(PVOID _arg)
   char Buffer[5000];
   char Format[100];
 
-  hThread = GetCurrentThread();
+  hThread = _GetCurrentThread();
   _SetThreadPriority(hThread, THREAD_PRIORITY_IDLE);
 
   memset(Buffer, 0, sizeof(Buffer));
@@ -84,8 +84,8 @@ PerformTest(PVOID _arg)
                               &time,
                               &ExecutionTime))
       {
-        ExecutionTime.dwLowDateTime = 10;
-        ExecutionTime.dwHighDateTime = 10;
+        ExecutionTime.dwLowDateTime = 0;
+        ExecutionTime.dwHighDateTime = 0;
       }
       sprintf(OutputBuffer,
               "[%s] Success [%s]\n",
@@ -108,7 +108,7 @@ PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName)
 {
   PLIST_ENTRY CurrentEntry;
   PLIST_ENTRY NextEntry;
-  PROS_TEST Current;
+  _PTEST Current;
   PERFORM_TEST_ARGS Args;
   HANDLE hThread;
   char OutputBuffer[1024];
@@ -122,7 +122,7 @@ PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName)
   for (; CurrentEntry != &AllTests; CurrentEntry = NextEntry)
     {
       NextEntry = CurrentEntry->Flink;
-      Current = CONTAINING_RECORD(CurrentEntry, ROS_TEST, ListEntry);
+      Current = CONTAINING_RECORD(CurrentEntry, _TEST, ListEntry);
       Args.Test = Current;
 
       /* Get name of test */
@@ -181,9 +181,9 @@ PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName)
 VOID
 AddTest(TestRoutine Routine)
 {
-  PROS_TEST Test;
+  _PTEST Test;
 
-  Test = (PROS_TEST) malloc(sizeof(ROS_TEST));
+  Test = (_PTEST) malloc(sizeof(_TEST));
   if (Test == NULL)
     {
       DbgPrint("Out of memory");
index 011b744..93ce5fe 100755 (executable)
@@ -141,27 +141,27 @@ typedef void (*TestOutputRoutine)(char *Buffer);
  */
 typedef void STDCALL (*TestDriverMain)(TestOutputRoutine OutputRoutine, char *TestName);
 
-typedef struct _ROS_TEST
+typedef struct __TEST
 {
   LIST_ENTRY ListEntry;
   TestRoutine Routine;
-} ROS_TEST, *PROS_TEST;
+} _TEST, *_PTEST;
 
 extern VOID InitializeTests();
 extern VOID RegisterTests();
 extern VOID PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName);
 
 
-typedef struct _API_DESCRIPTION
+typedef struct __API_DESCRIPTION
 {
   PCHAR FileName;
   PCHAR FunctionName;
   PCHAR ForwardedFunctionName;
   PVOID FunctionAddress;
   PVOID MockFunctionAddress;
-} API_DESCRIPTION, *PAPI_DESCRIPTION;
+} _API_DESCRIPTION, *_PAPI_DESCRIPTION;
 
-extern API_DESCRIPTION ExternalDependencies[];
+extern _API_DESCRIPTION ExternalDependencies[];
 extern ULONG MaxExternalDependency;
 
 HANDLE STDCALL
@@ -205,9 +205,15 @@ _SetPriorityClass(HANDLE hProcess, DWORD dwPriorityClass);
 BOOL STDCALL
 _SetThreadPriority(HANDLE hThread, int nPriority);
 
+HANDLE STDCALL
+_GetCurrentProcess();
+
+HANDLE STDCALL
+_GetCurrentThread();
+
 
 static inline PCHAR
-FrameworkGetExportedFunctionNameInternal(PAPI_DESCRIPTION ApiDescription)
+FrameworkGetExportedFunctionNameInternal(_PAPI_DESCRIPTION ApiDescription)
 {
   if (ApiDescription->ForwardedFunctionName != NULL)
     {
@@ -220,7 +226,7 @@ FrameworkGetExportedFunctionNameInternal(PAPI_DESCRIPTION ApiDescription)
 }
 
 static inline PVOID
-FrameworkGetFunction(PAPI_DESCRIPTION ApiDescription)
+FrameworkGetFunction(_PAPI_DESCRIPTION ApiDescription)
 {
   HANDLE hModule;
   PVOID function = NULL;
@@ -284,7 +290,7 @@ static inline VOID
 _SetHook(PCHAR name,
   PVOID address)
 {
-  PAPI_DESCRIPTION api;
+  _PAPI_DESCRIPTION api;
   ULONG index;
 
   for (index = 0; index <= MaxExternalDependency; index++)
@@ -298,16 +304,16 @@ _SetHook(PCHAR name,
     }
 }
 
-typedef struct _HOOK
+typedef struct __HOOK
 {
   PCHAR FunctionName;
   PVOID FunctionAddress;
-} HOOK, *PHOOK;
+} _HOOK, *_PHOOK;
 
 static inline VOID
-_SetHooks(PHOOK hookTable)
+_SetHooks(_PHOOK hookTable)
 {
-  PHOOK hook;
+  _PHOOK hook;
 
   hook = &hookTable[0];
   while (hook->FunctionName != NULL)
@@ -319,9 +325,9 @@ _SetHooks(PHOOK hookTable)
 }
 
 static inline VOID
-_UnsetHooks(PHOOK hookTable)
+_UnsetHooks(_PHOOK hookTable)
 {
-  PHOOK hook;
+  _PHOOK hook;
 
   hook = &hookTable[0];
   while (hook->FunctionName != NULL)
@@ -335,7 +341,7 @@ _UnsetHooks(PHOOK hookTable)
 static inline VOID
 _UnsetAllHooks()
 {
-  PAPI_DESCRIPTION api;
+  _PAPI_DESCRIPTION api;
   ULONG index;
 
   for (index = 0; index <= MaxExternalDependency; index++)
diff --git a/reactos/subsys/win32k/tests/stubs.tst b/reactos/subsys/win32k/tests/stubs.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/reactos/subsys/win32k/tests/stubs.xml b/reactos/subsys/win32k/tests/stubs.xml
new file mode 100644 (file)
index 0000000..06dd4a9
--- /dev/null
@@ -0,0 +1,154 @@
+<component name="ntdll.dll">
+       <symbol>DbgPrint</symbol>
+       <symbol>RtlAssert@16</symbol>
+       <symbol>ZwAllocateVirtualMemory@24</symbol>
+       <symbol>RtlImageDirectoryEntryToData@16</symbol>
+       <symbol>RtlInitAnsiString@8</symbol>
+       <symbol>RtlInitUnicodeString@8</symbol>
+       <symbol>NtClose@4</symbol>
+       <symbol>ZwOpenFile@24</symbol>
+       <symbol>ZwClose@4</symbol>
+       <symbol>RtlNtStatusToDosError@4</symbol>
+       <symbol>NtW32Call@20</symbol>
+       <symbol>ZwOpenKey@12</symbol>
+       <symbol>ZwQueryValueKey@24</symbol>
+       <symbol>RtlUnicodeStringToInteger@12</symbol>
+       <symbol>RtlQueryAtomInAtomTable@24</symbol>
+       <symbol>RtlDeleteAtomFromAtomTable@8</symbol>
+       <symbol>RtlCopyUnicodeString@8</symbol>
+       <symbol>ZwRequestWaitReplyPort@12</symbol>
+       <symbol>ZwDuplicateObject@28</symbol>
+       <symbol>ZwSetSystemInformation@12</symbol>
+       <symbol>RtlLookupAtomInAtomTable@12</symbol>
+       <symbol>RtlAddAtomToAtomTable@12</symbol>
+       <symbol>RtlFreeUnicodeString@4</symbol>
+       <symbol>ZwConnectPort@32</symbol>
+       <symbol>ZwOpenProcess@16</symbol>
+       <symbol>RtlCreateUnicodeString@8</symbol>
+       <symbol>RtlQueryRegistryValues@20</symbol>
+       <symbol>RtlGetVersion@4</symbol>
+       <symbol>NtOpenFile@24</symbol>
+       <symbol>NtReadFile@36</symbol>
+       <symbol>NtWaitForSingleObject@12</symbol>
+       <symbol>NtDeviceIoControlFile@40</symbol>
+       <symbol>NtAlertThread@4</symbol>
+       <symbol>ZwQueryDefaultLocale@8</symbol>
+       <symbol>ZwFreeVirtualMemory@16</symbol>
+       <symbol>RtlFindClearBitsAndSet@12</symbol>
+       <symbol>ZwReadFile@36</symbol>
+       <symbol>RtlAnsiStringToUnicodeString@12</symbol>
+       <symbol>RtlCompareUnicodeString@12</symbol>
+       <symbol>ZwCreateDirectoryObject@12</symbol>
+       <symbol>RtlCreateAtomTable@8</symbol>
+       <symbol>RtlDestroyAtomTable@4</symbol>
+       <symbol>ZwOpenDirectoryObject@12</symbol>
+       <symbol>ZwQueryDirectoryObject@28</symbol>
+       <symbol>RtlAppendUnicodeToString@8</symbol>
+       <symbol>ZwCreateEvent@20</symbol>
+       <symbol>RtlAreBitsSet@12</symbol>
+       <symbol>RtlClearBits@12</symbol>
+       <symbol>RtlInitializeBitMap@12</symbol>
+       <symbol>RtlClearAllBits@4</symbol>
+       <symbol>RtlAppendUnicodeStringToString@8</symbol>
+       <symbol>ZwSetValueKey@24</symbol>
+       <symbol>ZwQueryDirectoryFile@44</symbol>
+       <symbol>RtlUnwind@16</symbol>
+       <symbol>NtQueryInformationFile@20</symbol>
+</component>
+<component name="ntoskrnl.exe">
+       <symbol>ExAllocatePool@8</symbol>
+       <symbol>ExFreePool@4</symbol>
+       <symbol>ExAllocatePoolWithTag@12</symbol>
+       <symbol>IoBuildDeviceIoControlRequest@36</symbol>
+       <symbol>@IofCallDriver@8</symbol>
+       <symbol>KeWaitForSingleObject@20</symbol>
+       <symbol>@ExAcquireFastMutex@4</symbol>
+       <symbol>PsGetWin32Process@0</symbol>
+       <symbol>@ExReleaseFastMutex@4</symbol>
+       <symbol>@ExTryToAcquireFastMutex@4</symbol>
+       <symbol>KeInitializeEvent@12</symbol>
+       <symbol>ExEventObjectType</symbol>
+       <symbol>ObReferenceObjectByHandle@24</symbol>
+       <symbol>KeSetEvent@12</symbol>
+       <symbol>@ObfDereferenceObject@4</symbol>
+       <symbol>KeRestoreFloatingPointState@4</symbol>
+       <symbol>KeSaveFloatingPointState@4</symbol>
+       <symbol>MmSecureVirtualMemory@12</symbol>
+       <symbol>MmUnsecureVirtualMemory@4</symbol>
+       <symbol>IoGetCurrentProcess@0</symbol>
+       <symbol>KeQueryPerformanceCounter@4</symbol>
+       <symbol>ExInitializeResourceLite@4</symbol>
+       <symbol>ExAcquireResourceExclusiveLite@8</symbol>
+       <symbol>KeGetCurrentThread@0</symbol>
+       <symbol>PsGetCurrentProcessId@0</symbol>
+       <symbol>@InterlockedDecrement@4</symbol>
+       <symbol>@InterlockedExchange@8</symbol>
+       <symbol>KeBugCheck@4</symbol>
+       <symbol>ExDesktopObjectType</symbol>
+       <symbol>PsEstablishWin32Callouts@24</symbol>
+       <symbol>MmUnmapViewInSystemSpace@4</symbol>
+       <symbol>MmCreateSection@32</symbol>
+       <symbol>MmMapViewInSystemSpace@12</symbol>
+       <symbol>MmCopyToCaller@12</symbol>
+       <symbol>PsGetWin32Thread@0</symbol>
+       <symbol>KeDetachProcess@0</symbol>
+       <symbol>ExInitializePagedLookasideList@28</symbol>
+       <symbol>@InterlockedPushEntrySList@8</symbol>
+       <symbol>ExInterlockedInsertTailList@12</symbol>
+       <symbol>KeReleaseSpinLock@8</symbol>
+       <symbol>ObOpenObjectByName@28</symbol>
+       <symbol>ObOpenObjectByPointer@28</symbol>
+       <symbol>KeAcquireSpinLock@8</symbol>
+       <symbol>ExGetPreviousMode@0</symbol>
+       <symbol>PsGetCurrentThreadId@0</symbol>
+       <symbol>@ExReleaseResourceLite@4</symbol>
+       <symbol>ExIsResourceAcquiredExclusiveLite@</symbol>
+       <symbol>@InterlockedIncrement@4</symbol>
+       <symbol>@InterlockedCompareExchange@12</symbol>
+       <symbol>KeAddSystemServiceTable@20</symbol>
+       <symbol>IoFileObjectType</symbol>
+       <symbol>ObReferenceObjectByPointer@16</symbol>
+       <symbol>MmUnmapViewOfSection@8</symbol>
+       <symbol>MmCopyFromCaller@12</symbol>
+       <symbol>KiKernelApcDeliveryCheck@0</symbol>
+       <symbol>ExIsResourceAcquiredExclusiveLite@4</symbol>
+       <symbol>MmMapViewOfSection@40</symbol>
+       <symbol>KeAttachProcess@4</symbol>
+       <symbol>@InterlockedPopEntrySList@4</symbol>
+       <symbol>ExWindowStationObjectType</symbol>
+       <symbol>ObInsertObject@24</symbol>
+       <symbol>KeInitializeSpinLock@4</symbol>
+       <symbol>PsThreadType</symbol>
+       <symbol>PsCreateSystemThread@28</symbol>
+       <symbol>KeQueryTickCount@4</symbol>
+       <symbol>PsLookupThreadByThreadId@8</symbol>
+       <symbol>KeInitializeMutex@8</symbol>
+       <symbol>KeWaitForMutexObject@20</symbol>
+       <symbol>KeReleaseMutex@8</symbol>
+       <symbol>KeDelayExecutionThread@12</symbol>
+       <symbol>PsGetProcessId@4</symbol>
+       <symbol>ObCreateObject@36</symbol>
+       <symbol>KeClearEvent@4</symbol>
+       <symbol>PsLookupProcessByProcessId@8</symbol>
+       <symbol>PsProcessType</symbol>
+       <symbol>KeWaitForMultipleObjects@32</symbol>
+       <symbol>KeQuerySystemTime@4</symbol>
+       <symbol>ObReferenceObjectByName@32</symbol>
+       <symbol>HalQueryDisplayOwnership@0</symbol>
+       <symbol>IoDeviceObjectType</symbol>
+</component>
+<component name="freetype.dll">
+       <symbol>FT_Init_FreeType</symbol>
+       <symbol>FT_New_Memory_Face</symbol>
+       <symbol>FT_Done_Face</symbol>
+       <symbol>FT_MulFix</symbol>
+       <symbol>FT_Get_Sfnt_Table</symbol>
+       <symbol>FT_Get_First_Char</symbol>
+       <symbol>FT_Set_Pixel_Sizes</symbol>
+       <symbol>FT_Get_Char_Index</symbol>
+       <symbol>FT_Load_Glyph</symbol>
+       <symbol>FT_Get_Kerning</symbol>
+       <symbol>FT_Render_Glyph</symbol>
+       <symbol>FT_Set_Charmap</symbol>
+       <symbol>FT_Load_Sfnt_Table</symbol>
+</component>
diff --git a/reactos/subsys/win32k/tests/win32k.xml b/reactos/subsys/win32k/tests/win32k.xml
new file mode 100644 (file)
index 0000000..73b95ec
--- /dev/null
@@ -0,0 +1,25 @@
+<module name="win32k_test" type="test">
+       <include base="rtshared">.</include>
+       <include base="win32k">.</include>
+       <include base="win32k">include</include>
+       <define name="UNICODE" />
+       <define name="__USE_W32API" />
+       <define name="_WIN32_WINNT">0x0501</define>
+       <define name="WINVER">0x600</define>
+       <define name="_DISABLE_TIDENTS" />
+       <define name="_SEH_NO_NATIVE_NLG" />
+       <define name="_WIN32K_" />
+       <library>rtshared</library>
+       <library>regtests</library>
+       <library>win32k_base</library>
+       <library>pseh</library>
+       <library>rosrtl</library>
+       <library>msvcrt</library>
+       <linkerflag>-lgcc</linkerflag>
+       <linkerflag>-nostartfiles</linkerflag>
+       <linkerflag>-nostdlib</linkerflag>
+       <directory name="tests">
+       </directory>
+       <file>setup.c</file>
+       <xi:include href="stubs.xml" />
+</module>
index e2ea06c..896641a 100644 (file)
@@ -1,5 +1,4 @@
-<module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" warnings="true">\r
-       <importlibrary definition="win32k.def" />\r
+<module name="win32k_base" type="objectlibrary" warnings="true">\r
        <include base="win32k">.</include>\r
        <include base="win32k">include</include>\r
        <include base="ntoskrnl">include</include>\r
@@ -8,12 +7,8 @@
        <define name="__USE_W32API" />\r
        <define name="_WIN32_WINNT">0x0501</define>\r
        <define name="WINVER">0x600</define>\r
+       <define name="_SEH_NO_NATIVE_NLG" />\r
        <define name="_WIN32K_" />\r
-       <library>pseh</library>\r
-       <library>rosrtl</library>\r
-       <library>ntoskrnl</library>\r
-       <library>hal</library>\r
-       <library>freetype</library>\r
        <pch>w32k.h</pch>\r
        <directory name="dib">\r
                <file>dib1bpp.c</file>\r
                <file>stubs.c</file>\r
                <file>xpstubs.c</file>\r
        </directory>\r
+</module>\r
+<module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" warnings="true">\r
+       <importlibrary definition="win32k.def" />\r
+       <library>win32k_base</library>\r
+       <library>pseh</library>\r
+       <library>rosrtl</library>\r
+       <library>ntoskrnl</library>\r
+       <library>hal</library>\r
+       <library>freetype</library>\r
        <file>win32k.rc</file>\r
 </module>\r
+<directory name="tests">\r
+       <xi:include href="tests/win32k.xml" />\r
+</directory>\r
index 96b86c8..1830ab9 100644 (file)
@@ -494,6 +494,7 @@ private:
                                                 int* stubIndex );
        void WriteStubsFile ( Module& module );
        std::string GetStartupFilename ( Module& module );
+       bool IsUnknownCharacter ( char ch );
        std::string GetTestDispatcherName ( std::string filename );
        bool IsTestFile ( std::string& filename ) const;
        void GetSourceFilenames ( string_list& list,
index fb9e48f..f35b9af 100644 (file)
@@ -93,7 +93,7 @@ TestSupportCode::WriteHooksFile ( Module& module )
        s = s + sprintf ( s, "#include <windows.h>\n" );
        s = s + sprintf ( s, "#include \"regtests.h\"\n" );
        s = s + sprintf ( s, "\n" );
-       s = s + sprintf ( s, "API_DESCRIPTION ExternalDependencies[] =\n" );
+       s = s + sprintf ( s, "_API_DESCRIPTION ExternalDependencies[] =\n" );
        s = s + sprintf ( s, "{\n" );
 
        int symbolCount = 0;
@@ -121,18 +121,34 @@ TestSupportCode::GetStubsFilename ( Module& module )
        return NormalizeFilename ( Environment::GetIntermediatePath () + SSEP + module.GetBasePath () + SSEP + "_stubs.S" );
 }
 
+string
+GetImportSymbol ( const StubbedSymbol& symbol )
+{
+       if (symbol.symbol[0] == '@')
+               return "__imp_" + symbol.symbol;
+       else
+               return "__imp__" + symbol.symbol;
+}
+
 char*
 TestSupportCode::WriteStubbedSymbolToStubsFile ( char* buffer,
                                                  const StubbedComponent& component,
-                                                const StubbedSymbol& symbol,
+                                                 const StubbedSymbol& symbol,
                                                  int stubIndex )
 {
+       string importSymbol = GetImportSymbol( symbol );
        buffer = buffer + sprintf ( buffer,
                                    ".globl _%s\n",
                                    symbol.symbol.c_str () );
+       buffer = buffer + sprintf ( buffer,
+                                   ".globl %s\n",
+                                   importSymbol.c_str () );
        buffer = buffer + sprintf ( buffer,
                                    "_%s:\n",
                                    symbol.symbol.c_str () );
+       buffer = buffer + sprintf ( buffer,
+                                   "%s:\n",
+                                   importSymbol.c_str () );
        buffer = buffer + sprintf ( buffer,
                                    "  pushl $%d\n",
                                    stubIndex );
@@ -196,6 +212,18 @@ TestSupportCode::GetStartupFilename ( Module& module )
        return NormalizeFilename ( Environment::GetIntermediatePath () + SSEP + module.GetBasePath () + SSEP + "_startup.c" );
 }
 
+bool
+TestSupportCode::IsUnknownCharacter ( char ch )
+{
+       if ( ch >= 'a' && ch <= 'z' )
+               return false;
+       if ( ch >= 'A' && ch <= 'Z' )
+               return false;
+       if ( ch >= '0' && ch <= '9' )
+               return false;
+       return true;
+}
+
 string
 TestSupportCode::GetTestDispatcherName ( string filename )
 {
@@ -204,7 +232,10 @@ TestSupportCode::GetTestDispatcherName ( string filename )
                filenamePart[0] = toupper ( filenamePart[0] );
        for ( size_t i = 1; i < filenamePart.length (); i++ )
        {
-               filenamePart[i] = tolower ( filenamePart[i] );
+               if ( IsUnknownCharacter ( filenamePart[i] ) )
+                       filenamePart[i] = '_';
+               else
+                       filenamePart[i] = tolower ( filenamePart[i] );
        }
        return filenamePart + "Test";
 }
@@ -333,7 +364,7 @@ TestSupportCode::WriteStartupFile ( Module& module )
        s = s + sprintf ( s, "  LPSTR lpszCmdParam,\n" );
        s = s + sprintf ( s, "  int nCmdShow)\n" );
        s = s + sprintf ( s, "{\n" );
-       s = s + sprintf ( s, "  _SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);\n" );
+       s = s + sprintf ( s, "  _SetPriorityClass(_GetCurrentProcess(), IDLE_PRIORITY_CLASS);\n" );
        s = s + sprintf ( s, "  InitializeTests();\n" );
        s = s + sprintf ( s, "  RegisterTests();\n" );
        s = s + sprintf ( s, "  SetupOnce();\n" );