1998-11-01 15:00:21 +01:00
|
|
|
/*
|
|
|
|
* NT basis DLL
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
1998-11-01 15:00:21 +01:00
|
|
|
* This file contains the Nt* API functions of NTDLL.DLL.
|
2000-12-13 22:28:15 +01:00
|
|
|
* In the original ntdll.dll they all seem to just call int 0x2e (down to the NTOSKRNL)
|
1998-11-01 15:00:21 +01:00
|
|
|
*
|
|
|
|
* Copyright 1996-1998 Marcus Meissner
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1998-11-01 15:00:21 +01:00
|
|
|
*/
|
|
|
|
|
2009-09-15 21:38:07 +02:00
|
|
|
#include <string.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1999-06-12 16:55:11 +02:00
|
|
|
#include <stdio.h>
|
1998-11-01 15:00:21 +01:00
|
|
|
#include <stdlib.h>
|
2019-11-18 14:55:00 +01:00
|
|
|
|
2007-09-18 00:39:43 +02:00
|
|
|
#define NONAMELESSUNION
|
2005-11-28 17:32:54 +01:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2002-09-13 00:07:02 +02:00
|
|
|
#include "winternl.h"
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
#include "ntdll_misc.h"
|
2001-07-19 02:39:09 +02:00
|
|
|
#include "wine/server.h"
|
2009-09-15 21:38:07 +02:00
|
|
|
#include "ddk/wdm.h"
|
1999-03-09 18:47:51 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1999-03-09 18:47:51 +01:00
|
|
|
/*
|
|
|
|
* Token
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Misc
|
1998-11-01 15:00:21 +01:00
|
|
|
*/
|
1999-03-09 18:47:51 +01:00
|
|
|
|
2020-06-23 14:29:31 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* RtlIsProcessorFeaturePresent [NTDLL.@]
|
2012-10-22 23:22:51 +02:00
|
|
|
*/
|
2020-06-23 14:29:31 +02:00
|
|
|
BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature )
|
2018-11-26 17:00:06 +01:00
|
|
|
{
|
2020-06-23 14:29:31 +02:00
|
|
|
return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature];
|
2009-09-15 21:38:07 +02:00
|
|
|
}
|
|
|
|
|
2020-06-23 14:29:31 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* RtlGetNativeSystemInformation [NTDLL.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI /* DECLSPEC_HOTPATCH */ RtlGetNativeSystemInformation(
|
|
|
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
|
|
|
OUT PVOID SystemInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
OUT PULONG ResultLength)
|
2009-09-15 21:38:07 +02:00
|
|
|
{
|
2020-06-23 14:29:31 +02:00
|
|
|
FIXME( "semi-stub, SystemInformationClass %#x, SystemInformation %p, Length %#x, ResultLength %p.\n",
|
|
|
|
SystemInformationClass, SystemInformation, Length, ResultLength );
|
2009-09-15 21:38:07 +02:00
|
|
|
|
2020-06-23 14:29:31 +02:00
|
|
|
/* RtlGetNativeSystemInformation function is the same as NtQuerySystemInformation on some Win7
|
|
|
|
* versions but there are differences for earlier and newer versions, at least:
|
|
|
|
* - HighestUserAddress field for SystemBasicInformation;
|
|
|
|
* - Some information classes are not supported by RtlGetNativeSystemInformation. */
|
|
|
|
return NtQuerySystemInformation( SystemInformationClass, SystemInformation, Length, ResultLength );
|
2012-10-22 23:22:51 +02:00
|
|
|
}
|
2009-09-15 21:38:07 +02:00
|
|
|
|
2002-05-09 22:30:52 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* VerSetConditionMask (NTDLL.@)
|
|
|
|
*/
|
|
|
|
ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
|
|
|
|
BYTE dwConditionMask)
|
|
|
|
{
|
2002-05-20 00:20:09 +02:00
|
|
|
if(dwTypeBitMask == 0)
|
|
|
|
return dwlConditionMask;
|
|
|
|
dwConditionMask &= 0x07;
|
|
|
|
if(dwConditionMask == 0)
|
|
|
|
return dwlConditionMask;
|
|
|
|
|
|
|
|
if(dwTypeBitMask & VER_PRODUCT_TYPE)
|
|
|
|
dwlConditionMask |= dwConditionMask << 7*3;
|
|
|
|
else if (dwTypeBitMask & VER_SUITENAME)
|
|
|
|
dwlConditionMask |= dwConditionMask << 6*3;
|
|
|
|
else if (dwTypeBitMask & VER_SERVICEPACKMAJOR)
|
|
|
|
dwlConditionMask |= dwConditionMask << 5*3;
|
|
|
|
else if (dwTypeBitMask & VER_SERVICEPACKMINOR)
|
|
|
|
dwlConditionMask |= dwConditionMask << 4*3;
|
|
|
|
else if (dwTypeBitMask & VER_PLATFORMID)
|
|
|
|
dwlConditionMask |= dwConditionMask << 3*3;
|
|
|
|
else if (dwTypeBitMask & VER_BUILDNUMBER)
|
|
|
|
dwlConditionMask |= dwConditionMask << 2*3;
|
|
|
|
else if (dwTypeBitMask & VER_MAJORVERSION)
|
|
|
|
dwlConditionMask |= dwConditionMask << 1*3;
|
|
|
|
else if (dwTypeBitMask & VER_MINORVERSION)
|
|
|
|
dwlConditionMask |= dwConditionMask << 0*3;
|
2002-05-09 22:30:52 +02:00
|
|
|
return dwlConditionMask;
|
|
|
|
}
|