- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception...
[reactos.git] / reactos / ntoskrnl / rtl / misc.c
index 72432f4..9e2a565 100644 (file)
@@ -5,7 +5,7 @@
  * FILE:            ntoskrnl/rtl/misc.c
  * PURPOSE:         Various functions
  *
- * PROGRAMMERS:     Hartmut Birr
+ * PROGRAMMERS:     
  */
 
 /* INCLUDES *****************************************************************/
@@ -21,36 +21,19 @@ extern ULONG NtMajorVersion;
 extern ULONG NtMinorVersion;
 extern ULONG NtOSCSDVersion;
 
-/* header hell made me do this...sorry */
-typedef struct _OSVERSIONINFOW {
-  DWORD dwOSVersionInfoSize;
-  DWORD dwMajorVersion;
-  DWORD dwMinorVersion;
-  DWORD dwBuildNumber;
-  DWORD dwPlatformId;
-  WCHAR szCSDVersion[ 128 ];
-} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
-
-typedef struct _OSVERSIONINFOEXW {
- DWORD dwOSVersionInfoSize;
- DWORD dwMajorVersion;
- DWORD dwMinorVersion;
- DWORD dwBuildNumber;
- DWORD dwPlatformId;
- WCHAR szCSDVersion[ 128 ];
- WORD wServicePackMajor;
- WORD wServicePackMinor;
- WORD wSuiteMask;
- BYTE wProductType;
- BYTE wReserved;
-} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
-
-#ifndef VER_PLATFORM_WIN32_NT
-#define VER_PLATFORM_WIN32_NT  (2)
-#endif
-
 /* FUNCTIONS *****************************************************************/
 
+NTSTATUS
+NTAPI
+DebugPrint(IN PANSI_STRING DebugString,
+           IN ULONG ComponentId,
+           IN ULONG Level)
+{
+    /* Temporary hack */
+    KdpPrintString(DebugString->Buffer, DebugString->Length);
+    return STATUS_SUCCESS;
+}
+
 /*
 * @implemented
 */
@@ -75,12 +58,12 @@ RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
       lpVersionInformation->dwMinorVersion = NtMinorVersion;
       lpVersionInformation->dwBuildNumber = NtBuildNumber;
       lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
-      if(((NtOSCSDVersion >> 8) & 0xFF) != 0)
+      if(((CmNtCSDVersion >> 8) & 0xFF) != 0)
       {
         int i = _snwprintf(lpVersionInformation->szCSDVersion,
                            (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1,
                            L"Service Pack %d",
-                           ((NtOSCSDVersion >> 8) & 0xFF));
+                           ((CmNtCSDVersion >> 8) & 0xFF));
         lpVersionInformation->szCSDVersion[i] = L'\0';
       }
       else
@@ -90,9 +73,9 @@ RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
       if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
       {
          RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation;
-         InfoEx->wServicePackMajor = (NtOSCSDVersion >> 8) & 0xFF;
-         InfoEx->wServicePackMinor = NtOSCSDVersion & 0xFF;
-         InfoEx->wSuiteMask = SharedUserData->SuiteMask;
+         InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
+         InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
+         InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask;
          InfoEx->wProductType = SharedUserData->NtProductType;
       }