Prepare win32k for tests
Modified: trunk/reactos/lib/kernel32/tests/kernel32.xml
Deleted: trunk/reactos/lib/kernel32/tests/stubs.tst
Modified: trunk/reactos/lib/kernel32/tests/stubs.xml
Modified: trunk/reactos/lib/kernel32/tests/tests/CreateFile.c
Modified: trunk/reactos/regtests/regtests/regtests.c
Modified: trunk/reactos/regtests/regtests/regtests.def
Modified: trunk/reactos/regtests/shared/regtests.c
Modified: trunk/reactos/regtests/shared/regtests.h
Deleted: trunk/reactos/subsys/win32k/tests/stubs.tst
Added: trunk/reactos/subsys/win32k/tests/stubs.xml
Added: trunk/reactos/subsys/win32k/tests/win32k.xml
Modified: trunk/reactos/subsys/win32k/win32k.xml
Modified: trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/testsupportcode.cpp

Modified: trunk/reactos/lib/kernel32/tests/kernel32.xml
--- trunk/reactos/lib/kernel32/tests/kernel32.xml	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/lib/kernel32/tests/kernel32.xml	2005-06-18 06:17:10 UTC (rev 16022)
@@ -1,8 +1,10 @@
 <module name="kernel32_test" type="test">
 	<include base="rtshared">.</include>
-	<define name="__USE_W32API" />
 	<define name="_DISABLE_TIDENTS" />
 	<define name="_SEH_NO_NATIVE_NLG" />
+	<define name="__USE_W32API" />
+	<define name="_WIN32_WINNT">0x0502</define>
+	<define name="__NO_CTYPE_INLINES" />
 	<define name="WINVER">0x0500</define>
 	<library>rtshared</library>
 	<library>regtests</library>

Deleted: trunk/reactos/lib/kernel32/tests/stubs.tst
--- trunk/reactos/lib/kernel32/tests/stubs.tst	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/lib/kernel32/tests/stubs.tst	2005-06-18 06:17:10 UTC (rev 16022)
@@ -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

Modified: trunk/reactos/lib/kernel32/tests/stubs.xml
--- trunk/reactos/lib/kernel32/tests/stubs.xml	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/lib/kernel32/tests/stubs.xml	2005-06-18 06:17:10 UTC (rev 16022)
@@ -23,7 +23,7 @@
 	<symbol>NtCreateSection@28</symbol>
 	<symbol>NtDelayExecution@8</symbol>
 	<symbol>NtDeviceIoControlFile@40</symbol>
-	<symbol>_imp__NtDuplicateObject@28</symbol>
+	<symbol>NtDuplicateObject@28</symbol>
 	<symbol>NtFlushBuffersFile@8</symbol>
 	<symbol>NtFlushInstructionCache@12</symbol>
 	<symbol>NtFlushVirtualMemory@16</symbol>
@@ -44,7 +44,7 @@
 	<symbol>NtQueryDefaultUILanguage@4</symbol>
 	<symbol>NtQueryDirectoryFile@44</symbol>
 	<symbol>NtQueryInformationFile@20</symbol>
-	<symbol>_imp__NtQueryInformationProcess@20</symbol>
+	<symbol>NtQueryInformationProcess@20</symbol>
 	<symbol>NtQueryInformationThread@20</symbol>
 	<symbol>NtQueryObject@20</symbol>
 	<symbol>NtQuerySystemInformation@16</symbol>
@@ -60,7 +60,7 @@
 	<symbol>NtSetEvent@8</symbol>
 	<symbol>NtSetInformationFile@20</symbol>
 	<symbol>NtSetInformationObject@16</symbol>
-	<symbol>_imp__NtSetInformationProcess@16</symbol>
+	<symbol>NtSetInformationProcess@16</symbol>
 	<symbol>NtSetInformationThread@16</symbol>
 	<symbol>NtSetSystemInformation@12</symbol>
 	<symbol>NtSetSystemTime@8</symbol>
@@ -76,7 +76,7 @@
 	<symbol>NtYieldExecution@0</symbol>
 	<symbol>RtlAcquirePebLock@0</symbol>
 	<symbol>RtlAnsiStringToUnicodeSize@4</symbol>
-	<symbol>_imp__RtlBaseProcessStartRoutine</symbol>
+	<symbol>RtlBaseProcessStartRoutine</symbol>
 	<symbol>RtlCompactHeap@8</symbol>
 	<symbol>RtlCopyUnicodeString@8</symbol>
 	<symbol>RtlCreateHeap@24</symbol>

Modified: trunk/reactos/lib/kernel32/tests/tests/CreateFile.c
--- trunk/reactos/lib/kernel32/tests/tests/CreateFile.c	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/lib/kernel32/tests/tests/CreateFile.c	2005-06-18 06:17:10 UTC (rev 16022)
@@ -90,7 +90,7 @@
   return STATUS_SUCCESS;
 }
 
-static HOOK NtCreateFileHooks[] =
+static _HOOK NtCreateFileHooks[] =
 {
   {"NtCreateFile", MockNtCreateFile},
   {NULL, NULL}

Modified: trunk/reactos/regtests/regtests/regtests.c
--- trunk/reactos/regtests/regtests/regtests.c	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/regtests/regtests/regtests.c	2005-06-18 06:17:10 UTC (rev 16022)
@@ -86,3 +86,15 @@
 {
   return SetThreadPriority(hThread, nPriority);
 }
+
+HANDLE STDCALL
+_GetCurrentProcess()
+{
+  return GetCurrentProcess();
+}
+
+HANDLE STDCALL
+_GetCurrentThread()
+{
+  return GetCurrentThread();
+}

Modified: trunk/reactos/regtests/regtests/regtests.def
--- trunk/reactos/regtests/regtests/regtests.def	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/regtests/regtests/regtests.def	2005-06-18 06:17:10 UTC (rev 16022)
@@ -12,3 +12,5 @@
 _GetThreadTimes@20
 _SetPriorityClass@8
 _SetThreadPriority@8
+_GetCurrentProcess@0
+_GetCurrentThread@0

Modified: trunk/reactos/regtests/shared/regtests.c
--- trunk/reactos/regtests/shared/regtests.c	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/regtests/shared/regtests.c	2005-06-18 06:17:10 UTC (rev 16022)
@@ -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 @@
 {
   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 @@
   char Buffer[5000];
   char Format[100];
 
-  hThread = GetCurrentThread();
+  hThread = _GetCurrentThread();
   _SetThreadPriority(hThread, THREAD_PRIORITY_IDLE);
 
   memset(Buffer, 0, sizeof(Buffer));
@@ -84,8 +84,8 @@
   	                       &time,
   	                       &ExecutionTime))
       {
-        ExecutionTime.dwLowDateTime = 10;
-        ExecutionTime.dwHighDateTime = 10;
+        ExecutionTime.dwLowDateTime = 0;
+        ExecutionTime.dwHighDateTime = 0;
       }
       sprintf(OutputBuffer,
               "[%s] Success [%s]\n",
@@ -108,7 +108,7 @@
 {
   PLIST_ENTRY CurrentEntry;
   PLIST_ENTRY NextEntry;
-  PROS_TEST Current;
+  _PTEST Current;
   PERFORM_TEST_ARGS Args;
   HANDLE hThread;
   char OutputBuffer[1024];
@@ -122,7 +122,7 @@
   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 @@
 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");

Modified: trunk/reactos/regtests/shared/regtests.h
--- trunk/reactos/regtests/shared/regtests.h	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/regtests/shared/regtests.h	2005-06-18 06:17:10 UTC (rev 16022)
@@ -141,27 +141,27 @@
  */
 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 @@
 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 @@
 }
 
 static inline PVOID
-FrameworkGetFunction(PAPI_DESCRIPTION ApiDescription)
+FrameworkGetFunction(_PAPI_DESCRIPTION ApiDescription)
 {
   HANDLE hModule;
   PVOID function = NULL;
@@ -284,7 +290,7 @@
 _SetHook(PCHAR name,
   PVOID address)
 {
-  PAPI_DESCRIPTION api;
+  _PAPI_DESCRIPTION api;
   ULONG index;
 
   for (index = 0; index <= MaxExternalDependency; index++)
@@ -298,16 +304,16 @@
     }
 }
 
-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 @@
 }
 
 static inline VOID
-_UnsetHooks(PHOOK hookTable)
+_UnsetHooks(_PHOOK hookTable)
 {
-  PHOOK hook;
+  _PHOOK hook;
 
   hook = &hookTable[0];
   while (hook->FunctionName != NULL)
@@ -335,7 +341,7 @@
 static inline VOID
 _UnsetAllHooks()
 {
-  PAPI_DESCRIPTION api;
+  _PAPI_DESCRIPTION api;
   ULONG index;
 
   for (index = 0; index <= MaxExternalDependency; index++)

Deleted: trunk/reactos/subsys/win32k/tests/stubs.tst

Added: trunk/reactos/subsys/win32k/tests/stubs.xml
--- trunk/reactos/subsys/win32k/tests/stubs.xml	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/subsys/win32k/tests/stubs.xml	2005-06-18 06:17:10 UTC (rev 16022)
@@ -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>
Property changes on: trunk/reactos/subsys/win32k/tests/stubs.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/reactos/subsys/win32k/tests/win32k.xml
--- trunk/reactos/subsys/win32k/tests/win32k.xml	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/subsys/win32k/tests/win32k.xml	2005-06-18 06:17:10 UTC (rev 16022)
@@ -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>
Property changes on: trunk/reactos/subsys/win32k/tests/win32k.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/reactos/subsys/win32k/win32k.xml
--- trunk/reactos/subsys/win32k/win32k.xml	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/subsys/win32k/win32k.xml	2005-06-18 06:17:10 UTC (rev 16022)
@@ -1,5 +1,4 @@
-<module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" warnings="true">
-	<importlibrary definition="win32k.def" />
+<module name="win32k_base" type="objectlibrary" warnings="true">
 	<include base="win32k">.</include>
 	<include base="win32k">include</include>
 	<include base="ntoskrnl">include</include>
@@ -8,12 +7,8 @@
 	<define name="__USE_W32API" />
 	<define name="_WIN32_WINNT">0x0501</define>
 	<define name="WINVER">0x600</define>
+	<define name="_SEH_NO_NATIVE_NLG" />
 	<define name="_WIN32K_" />
-	<library>pseh</library>
-	<library>rosrtl</library>
-	<library>ntoskrnl</library>
-	<library>hal</library>
-	<library>freetype</library>
 	<pch>w32k.h</pch>
 	<directory name="dib">
 		<file>dib1bpp.c</file>
@@ -132,5 +127,17 @@
 		<file>stubs.c</file>
 		<file>xpstubs.c</file>
 	</directory>
+</module>
+<module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" warnings="true">
+	<importlibrary definition="win32k.def" />
+	<library>win32k_base</library>
+	<library>pseh</library>
+	<library>rosrtl</library>
+	<library>ntoskrnl</library>
+	<library>hal</library>
+	<library>freetype</library>
 	<file>win32k.rc</file>
 </module>
+<directory name="tests">
+	<xi:include href="tests/win32k.xml" />
+</directory>

Modified: trunk/reactos/tools/rbuild/rbuild.h
--- trunk/reactos/tools/rbuild/rbuild.h	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/tools/rbuild/rbuild.h	2005-06-18 06:17:10 UTC (rev 16022)
@@ -494,6 +494,7 @@
 	                                         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,

Modified: trunk/reactos/tools/rbuild/testsupportcode.cpp
--- trunk/reactos/tools/rbuild/testsupportcode.cpp	2005-06-17 22:59:39 UTC (rev 16021)
+++ trunk/reactos/tools/rbuild/testsupportcode.cpp	2005-06-18 06:17:10 UTC (rev 16022)
@@ -93,7 +93,7 @@
 	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,19 +121,35 @@
 	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 );
 	buffer = buffer + sprintf ( buffer,
@@ -196,6 +212,18 @@
 	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 @@
 		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 @@
 	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" );