2005-05-09 01:38:29 +00:00
|
|
|
/* $Id$
|
2005-05-01 07:08:18 +00:00
|
|
|
*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* FILE: ntoskrnl/rtl/misc.c
|
|
|
|
* PURPOSE: Various functions
|
2005-05-09 01:38:29 +00:00
|
|
|
*
|
2006-01-17 23:11:13 +00:00
|
|
|
* PROGRAMMERS:
|
2005-05-01 07:08:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
|
|
|
#include <ntoskrnl.h>
|
|
|
|
#define NDEBUG
|
|
|
|
#include <internal/debug.h>
|
|
|
|
|
|
|
|
/* GLOBALS *******************************************************************/
|
|
|
|
|
|
|
|
extern ULONG NtGlobalFlag;
|
|
|
|
extern ULONG NtMajorVersion;
|
|
|
|
extern ULONG NtMinorVersion;
|
|
|
|
extern ULONG NtOSCSDVersion;
|
|
|
|
|
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
- More sharing between ntdll/ntoskrnl: shared Dbg code.
- Added NtCreateDebugObject, NtDebugContinue, NtQueryDebugFilterState, NtSetDebugFilterState, NtWaitForDebugEvent to system call list.
- Added some debug constants to headers
- Updated RtlpCheckForActiveDebugger in ntoskrnl to return whatever we're expecting as the "normal" case.
- Added RtlpSetInDbgPrint to rtl support library for special DbgPrint implementation difference in user-mode
- Removed all the deprecated debug APIs in ntdll.
- Implemented NtQueryDebugFilterState and NtSetDebugFilterState based on royce's implementation.
- Started modifications on KeDebugService, and implemented DebugService in rtl
- Implemented all the Dbg* APIs in RTL.
- Implemented DbgUiConnectToDbg, DbgUiContinue, DbgUiWaitStateChange, DbgUiRemoteBreakin, DbgUiIssueRemoteBreakin
- Changed KD Print callbacks to also receive the length of the string.
Right now, one call that should be shared still isn't (the final DebugPrint call) because calling KeDebugService from kernel-mode seems to cause a hang. Also, DebugService does not currently cause an exception like it should (instead it still calls the Kdp handler), because those changes would've made the patch even bigger and are still untested.
svn path=/trunk/; revision=18078
2005-09-26 04:59:48 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DebugPrint(IN PANSI_STRING DebugString,
|
|
|
|
IN ULONG ComponentId,
|
|
|
|
IN ULONG Level)
|
|
|
|
{
|
|
|
|
/* Temporary hack */
|
|
|
|
KdpPrintString(DebugString->Buffer, DebugString->Length);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-05-01 07:08:18 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
STDCALL
|
|
|
|
RtlGetNtGlobalFlags(VOID)
|
|
|
|
{
|
|
|
|
return(NtGlobalFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS STDCALL
|
|
|
|
RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
|
|
|
|
{
|
|
|
|
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) ||
|
|
|
|
lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
|
|
|
|
{
|
|
|
|
lpVersionInformation->dwMajorVersion = NtMajorVersion;
|
|
|
|
lpVersionInformation->dwMinorVersion = NtMinorVersion;
|
|
|
|
lpVersionInformation->dwBuildNumber = NtBuildNumber;
|
|
|
|
lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
|
|
|
|
if(((NtOSCSDVersion >> 8) & 0xFF) != 0)
|
|
|
|
{
|
|
|
|
int i = _snwprintf(lpVersionInformation->szCSDVersion,
|
|
|
|
(sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1,
|
|
|
|
L"Service Pack %d",
|
|
|
|
((NtOSCSDVersion >> 8) & 0xFF));
|
|
|
|
lpVersionInformation->szCSDVersion[i] = L'\0';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RtlZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
|
|
|
|
}
|
|
|
|
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->wProductType = SharedUserData->NtProductType;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|