1998-11-01 14:00:21 +00:00
|
|
|
/*
|
|
|
|
* NT basis DLL
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1998-11-01 14:00:21 +00:00
|
|
|
* This file contains the Nt* API functions of NTDLL.DLL.
|
2000-12-13 21:28:15 +00:00
|
|
|
* In the original ntdll.dll they all seem to just call int 0x2e (down to the NTOSKRNL)
|
1998-11-01 14:00:21 +00:00
|
|
|
*
|
|
|
|
* Copyright 1996-1998 Marcus Meissner
|
2002-03-09 23:29:33 +00: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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
|
|
|
|
1999-06-12 14:55:11 +00:00
|
|
|
#include <stdio.h>
|
1998-11-01 14:00:21 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
1999-02-13 07:35:31 +00:00
|
|
|
|
2002-09-12 22:07:02 +00: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 22:35:33 +00:00
|
|
|
#include "ntdll_misc.h"
|
2001-07-19 00:39:09 +00:00
|
|
|
#include "wine/server.h"
|
1999-03-09 17:47:51 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Timer object
|
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/**************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtCreateTimer [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwCreateTimer [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-02-13 07:35:31 +00:00
|
|
|
NTSTATUS WINAPI NtCreateTimer(
|
|
|
|
OUT PHANDLE TimerHandle,
|
|
|
|
IN ACCESS_MASK DesiredAccess,
|
|
|
|
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
|
|
|
|
IN TIMER_TYPE TimerType)
|
1998-11-01 14:00:21 +00:00
|
|
|
{
|
- 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 22:35:33 +00:00
|
|
|
FIXME("(%p,0x%08lx,%p,0x%08x) stub\n",
|
|
|
|
TimerHandle,DesiredAccess,ObjectAttributes, TimerType);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/**************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtSetTimer [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwSetTimer [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-02-13 07:35:31 +00:00
|
|
|
NTSTATUS WINAPI NtSetTimer(
|
1999-02-26 11:11:13 +00:00
|
|
|
IN HANDLE TimerHandle,
|
1999-02-13 07:35:31 +00:00
|
|
|
IN PLARGE_INTEGER DueTime,
|
|
|
|
IN PTIMERAPCROUTINE TimerApcRoutine,
|
|
|
|
IN PVOID TimerContext,
|
1999-02-19 16:29:05 +00:00
|
|
|
IN BOOLEAN WakeTimer,
|
1999-02-13 07:35:31 +00:00
|
|
|
IN ULONG Period OPTIONAL,
|
|
|
|
OUT PBOOLEAN PreviousState OPTIONAL)
|
1998-11-01 14:00:21 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
|
1999-02-13 07:35:31 +00:00
|
|
|
TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtQueryTimerResolution [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3)
|
1998-11-01 14:00:21 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
|
1999-03-09 17:47:51 +00:00
|
|
|
return 1;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Process object
|
1999-02-13 07:35:31 +00:00
|
|
|
*/
|
1998-11-01 14:00:21 +00:00
|
|
|
|
1999-04-11 14:53:24 +00:00
|
|
|
/******************************************************************************
|
2001-06-28 18:04:41 +00:00
|
|
|
* NtTerminateProcess [NTDLL.@]
|
1999-04-11 14:53:24 +00:00
|
|
|
*
|
|
|
|
* Native applications must kill themselves when done
|
|
|
|
*/
|
2000-07-29 21:56:59 +00:00
|
|
|
NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
|
1999-04-11 14:53:24 +00:00
|
|
|
{
|
2000-07-29 21:56:59 +00:00
|
|
|
NTSTATUS ret;
|
2000-08-30 00:00:48 +00:00
|
|
|
BOOL self;
|
2001-02-27 02:09:16 +00:00
|
|
|
SERVER_START_REQ( terminate_process )
|
2000-08-30 00:00:48 +00:00
|
|
|
{
|
|
|
|
req->handle = handle;
|
|
|
|
req->exit_code = exit_code;
|
2001-11-30 18:46:42 +00:00
|
|
|
ret = wine_server_call( req );
|
|
|
|
self = !ret && reply->self;
|
2000-08-30 00:00:48 +00:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
if (self) exit( exit_code );
|
2000-07-29 21:56:59 +00:00
|
|
|
return ret;
|
1999-04-11 14:53:24 +00:00
|
|
|
}
|
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-28 18:04:41 +00:00
|
|
|
* NtQueryInformationProcess [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwQueryInformationProcess [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryInformationProcess(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
IN PROCESSINFOCLASS ProcessInformationClass,
|
|
|
|
OUT PVOID ProcessInformation,
|
|
|
|
IN ULONG ProcessInformationLength,
|
|
|
|
OUT PULONG ReturnLength)
|
1998-11-01 14:00:21 +00:00
|
|
|
{
|
2002-05-01 22:02:02 +00:00
|
|
|
NTSTATUS ret = STATUS_SUCCESS;
|
|
|
|
ULONG len = 0;
|
2000-06-25 12:51:55 +00:00
|
|
|
|
2002-05-01 22:02:02 +00:00
|
|
|
switch (ProcessInformationClass) {
|
|
|
|
case ProcessDebugPort:
|
|
|
|
/* "These are not the debuggers you are looking for." */
|
|
|
|
/* set it to 0 aka "no debugger" to satisfy copy protections */
|
|
|
|
if (ProcessInformationLength == 4)
|
|
|
|
{
|
|
|
|
memset(ProcessInformation,0,ProcessInformationLength);
|
|
|
|
len = 4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = STATUS_INFO_LENGTH_MISMATCH;
|
|
|
|
break;
|
|
|
|
default:
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08x,%p,0x%08lx,%p),stub!\n",
|
2002-05-01 22:02:02 +00:00
|
|
|
ProcessHandle,ProcessInformationClass,
|
|
|
|
ProcessInformation,ProcessInformationLength,
|
|
|
|
ReturnLength
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ReturnLength)
|
|
|
|
*ReturnLength = len;
|
|
|
|
|
|
|
|
return ret;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtSetInformationProcess [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwSetInformationProcess [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-02-13 07:35:31 +00:00
|
|
|
NTSTATUS WINAPI NtSetInformationProcess(
|
1999-02-26 11:11:13 +00:00
|
|
|
IN HANDLE ProcessHandle,
|
1999-02-13 07:35:31 +00:00
|
|
|
IN PROCESSINFOCLASS ProcessInformationClass,
|
|
|
|
IN PVOID ProcessInformation,
|
|
|
|
IN ULONG ProcessInformationLength)
|
1998-11-01 14:00:21 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08x,%p,0x%08lx) stub\n",
|
1999-02-13 07:35:31 +00:00
|
|
|
ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
|
1999-03-09 17:47:51 +00:00
|
|
|
return 0;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Thread
|
|
|
|
*/
|
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtResumeThread [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwResumeThread [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtResumeThread(
|
|
|
|
IN HANDLE ThreadHandle,
|
2002-05-31 23:06:46 +00:00
|
|
|
IN PULONG SuspendCount)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,%p),stub!\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
ThreadHandle,SuspendCount);
|
1999-02-13 07:35:31 +00:00
|
|
|
return 0;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
2000-08-30 00:00:48 +00:00
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtTerminateThread [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwTerminateThread [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2000-08-30 00:00:48 +00:00
|
|
|
NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code )
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2000-07-29 21:56:59 +00:00
|
|
|
NTSTATUS ret;
|
2000-08-30 00:00:48 +00:00
|
|
|
BOOL self, last;
|
|
|
|
|
2001-02-27 02:09:16 +00:00
|
|
|
SERVER_START_REQ( terminate_thread )
|
2000-07-29 21:56:59 +00:00
|
|
|
{
|
2000-08-30 00:00:48 +00:00
|
|
|
req->handle = handle;
|
|
|
|
req->exit_code = exit_code;
|
2001-11-30 18:46:42 +00:00
|
|
|
ret = wine_server_call( req );
|
|
|
|
self = !ret && reply->self;
|
|
|
|
last = reply->last;
|
2000-08-30 00:00:48 +00:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
|
|
|
|
if (self)
|
|
|
|
{
|
|
|
|
if (last) exit( exit_code );
|
2000-07-29 21:56:59 +00:00
|
|
|
else SYSDEPS_ExitThread( exit_code );
|
|
|
|
}
|
|
|
|
return ret;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
1999-03-09 17:47:51 +00:00
|
|
|
|
2000-08-30 00:00:48 +00:00
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-28 18:04:41 +00:00
|
|
|
* NtQueryInformationThread [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwQueryInformationThread [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*
|
|
|
|
*/
|
1999-02-13 07:35:31 +00:00
|
|
|
NTSTATUS WINAPI NtQueryInformationThread(
|
1999-02-26 11:11:13 +00:00
|
|
|
IN HANDLE ThreadHandle,
|
1999-02-13 07:35:31 +00:00
|
|
|
IN THREADINFOCLASS ThreadInformationClass,
|
|
|
|
OUT PVOID ThreadInformation,
|
|
|
|
IN ULONG ThreadInformationLength,
|
|
|
|
OUT PULONG ReturnLength)
|
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08x,%p,0x%08lx,%p),stub!\n",
|
1999-02-13 07:35:31 +00:00
|
|
|
ThreadHandle, ThreadInformationClass, ThreadInformation,
|
|
|
|
ThreadInformationLength, ReturnLength);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-03-09 17:47:51 +00:00
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtSetInformationThread [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwSetInformationThread [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetInformationThread(
|
|
|
|
HANDLE ThreadHandle,
|
|
|
|
THREADINFOCLASS ThreadInformationClass,
|
|
|
|
PVOID ThreadInformation,
|
|
|
|
ULONG ThreadInformationLength)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08x,%p,0x%08lx),stub!\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Token
|
|
|
|
*/
|
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtDuplicateToken [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwDuplicateToken [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtDuplicateToken(
|
|
|
|
IN HANDLE ExistingToken,
|
|
|
|
IN ACCESS_MASK DesiredAccess,
|
|
|
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
|
|
|
|
IN TOKEN_TYPE TokenType,
|
|
|
|
OUT PHANDLE NewToken)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
|
- 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 22:35:33 +00:00
|
|
|
ExistingToken, DesiredAccess, ObjectAttributes,
|
|
|
|
ImpersonationLevel, TokenType, NewToken);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtOpenProcessToken [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwOpenProcessToken [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtOpenProcessToken(
|
|
|
|
HANDLE ProcessHandle,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD DesiredAccess,
|
|
|
|
HANDLE *TokenHandle)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08lx,%p): stub\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
ProcessHandle,DesiredAccess, TokenHandle);
|
2002-07-31 19:26:03 +00:00
|
|
|
*TokenHandle = (HANDLE)0xcafe;
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtOpenThreadToken [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwOpenThreadToken [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtOpenThreadToken(
|
|
|
|
HANDLE ThreadHandle,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD DesiredAccess,
|
1999-03-09 17:47:51 +00:00
|
|
|
BOOLEAN OpenAsSelf,
|
2002-05-31 23:06:46 +00:00
|
|
|
HANDLE *TokenHandle)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08lx,0x%08x,%p): stub\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
|
2002-07-31 19:26:03 +00:00
|
|
|
*TokenHandle = (HANDLE)0xcafe;
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtAdjustPrivilegesToken [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwAdjustGroupsToken [NTDLL.@]
|
1999-02-13 07:35:31 +00:00
|
|
|
*
|
|
|
|
* FIXME: parameters unsafe
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtAdjustPrivilegesToken(
|
1999-02-26 11:11:13 +00:00
|
|
|
IN HANDLE TokenHandle,
|
1999-02-19 16:29:05 +00:00
|
|
|
IN BOOLEAN DisableAllPrivileges,
|
1999-02-13 07:35:31 +00:00
|
|
|
IN PTOKEN_PRIVILEGES NewState,
|
|
|
|
IN DWORD BufferLength,
|
|
|
|
OUT PTOKEN_PRIVILEGES PreviousState,
|
|
|
|
OUT PDWORD ReturnLength)
|
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
|
1999-02-13 07:35:31 +00:00
|
|
|
TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtQueryInformationToken [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwQueryInformationToken [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*
|
- 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 22:35:33 +00:00
|
|
|
* NOTES
|
|
|
|
* Buffer for TokenUser:
|
|
|
|
* 0x00 TOKEN_USER the PSID field points to the SID
|
|
|
|
* 0x08 SID
|
|
|
|
*
|
1999-03-09 17:47:51 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryInformationToken(
|
|
|
|
HANDLE token,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD tokeninfoclass,
|
1999-03-09 17:47:51 +00:00
|
|
|
LPVOID tokeninfo,
|
|
|
|
DWORD tokeninfolength,
|
2002-05-31 23:06:46 +00:00
|
|
|
LPDWORD retlen )
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2000-11-01 21:38:09 +00:00
|
|
|
unsigned int len = 0;
|
|
|
|
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(%p,%ld,%p,%ld,%p): stub\n",
|
2000-11-01 21:38:09 +00:00
|
|
|
token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
|
|
|
|
|
|
|
|
switch (tokeninfoclass)
|
|
|
|
{
|
|
|
|
case TokenUser:
|
|
|
|
len = sizeof(TOKEN_USER) + sizeof(SID);
|
|
|
|
break;
|
|
|
|
case TokenGroups:
|
|
|
|
len = sizeof(TOKEN_GROUPS);
|
|
|
|
break;
|
|
|
|
case TokenPrivileges:
|
|
|
|
len = sizeof(TOKEN_PRIVILEGES);
|
|
|
|
break;
|
|
|
|
case TokenOwner:
|
|
|
|
len = sizeof(TOKEN_OWNER);
|
|
|
|
break;
|
|
|
|
case TokenPrimaryGroup:
|
|
|
|
len = sizeof(TOKEN_PRIMARY_GROUP);
|
|
|
|
break;
|
|
|
|
case TokenDefaultDacl:
|
|
|
|
len = sizeof(TOKEN_DEFAULT_DACL);
|
|
|
|
break;
|
|
|
|
case TokenSource:
|
|
|
|
len = sizeof(TOKEN_SOURCE);
|
|
|
|
break;
|
|
|
|
case TokenType:
|
|
|
|
len = sizeof (TOKEN_TYPE);
|
|
|
|
break;
|
1999-12-11 23:19:54 +00:00
|
|
|
#if 0
|
2000-11-01 21:38:09 +00:00
|
|
|
case TokenImpersonationLevel:
|
|
|
|
case TokenStatistics:
|
1999-04-25 19:01:52 +00:00
|
|
|
#endif /* 0 */
|
2000-11-01 21:38:09 +00:00
|
|
|
}
|
1998-11-01 14:00:21 +00:00
|
|
|
|
2000-11-01 21:38:09 +00:00
|
|
|
/* FIXME: what if retlen == NULL ? */
|
|
|
|
*retlen = len;
|
|
|
|
|
|
|
|
if (tokeninfolength < len)
|
|
|
|
return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
|
|
|
|
switch (tokeninfoclass)
|
|
|
|
{
|
|
|
|
case TokenUser:
|
|
|
|
if( tokeninfo )
|
|
|
|
{
|
|
|
|
TOKEN_USER * tuser = tokeninfo;
|
|
|
|
PSID sid = (PSID) (tuser + 1);
|
|
|
|
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
|
|
|
|
RtlInitializeSid(sid, &localSidAuthority, 1);
|
|
|
|
*(RtlSubAuthoritySid(sid, 0)) = SECURITY_INTERACTIVE_RID;
|
|
|
|
tuser->User.Sid = sid;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TokenGroups:
|
|
|
|
if (tokeninfo)
|
|
|
|
{
|
|
|
|
TOKEN_GROUPS *tgroups = tokeninfo;
|
|
|
|
SID_IDENTIFIER_AUTHORITY sid = {SECURITY_NT_AUTHORITY};
|
|
|
|
|
|
|
|
/* we need to show admin privileges ! */
|
|
|
|
tgroups->GroupCount = 1;
|
|
|
|
RtlAllocateAndInitializeSid( &sid,
|
|
|
|
2,
|
|
|
|
SECURITY_BUILTIN_DOMAIN_RID,
|
|
|
|
DOMAIN_ALIAS_RID_ADMINS,
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
&(tgroups->Groups->Sid));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TokenPrivileges:
|
|
|
|
if (tokeninfo)
|
|
|
|
{
|
|
|
|
TOKEN_PRIVILEGES *tpriv = tokeninfo;
|
|
|
|
tpriv->PrivilegeCount = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Section
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtQuerySection [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtQuerySection(
|
|
|
|
IN HANDLE SectionHandle,
|
|
|
|
IN PVOID SectionInformationClass,
|
|
|
|
OUT PVOID SectionInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
OUT PULONG ResultLength)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2002-11-21 03:45:01 +00:00
|
|
|
FIXME("(0x%p,%p,%p,0x%08lx,%p) stub!\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* ports
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtCreatePort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwCreatePort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtConnectPort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwConnectPort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
|
1999-03-09 17:47:51 +00:00
|
|
|
x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtListenPort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwListenPort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtAcceptConnectPort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwAcceptConnectPort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtCompleteConnectPort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwCompleteConnectPort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx),stub!\n",x1);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtRegisterThreadTerminatePort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwRegisterThreadTerminatePort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx),stub!\n",x1);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtRequestWaitReplyPort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwRequestWaitReplyPort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
|
1999-03-09 17:47:51 +00:00
|
|
|
return 0;
|
1998-11-01 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtReplyWaitReceivePort [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwReplyWaitReceivePort [NTDLL.@]
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4)
|
1999-03-09 17:47:51 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-03-09 17:47:51 +00:00
|
|
|
/*
|
|
|
|
* Misc
|
1998-11-01 14:00:21 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtSetIntervalProfile [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwSetIntervalProfile [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
|
1998-11-01 14:00:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-03-09 17:47:51 +00:00
|
|
|
|
1998-12-24 14:34:55 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtQueryPerformanceCounter [NTDLL.@]
|
1998-12-24 14:34:55 +00:00
|
|
|
*/
|
1999-02-19 16:29:05 +00:00
|
|
|
NTSTATUS WINAPI NtQueryPerformanceCounter(
|
1999-02-13 07:35:31 +00:00
|
|
|
IN PLARGE_INTEGER Counter,
|
2002-05-31 23:06:46 +00:00
|
|
|
IN PLARGE_INTEGER Frequency)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(%p, 0%p) stub\n",
|
1999-02-13 07:35:31 +00:00
|
|
|
Counter, Frequency);
|
1998-12-24 14:34:55 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtCreateMailslotFile [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwCreateMailslotFile [NTDLL.@]
|
1999-02-13 07:35:31 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6,x7,x8);
|
1999-02-13 07:35:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-12-24 14:34:55 +00:00
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtQuerySystemInformation [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwQuerySystemInformation [NTDLL.@]
|
1999-03-09 17:47:51 +00:00
|
|
|
*
|
|
|
|
* ARGUMENTS:
|
|
|
|
* SystemInformationClass Index to a certain information structure
|
|
|
|
* SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
|
|
|
|
* SystemCacheInformation SYSTEM_CACHE_INFORMATION
|
|
|
|
* SystemConfigurationInformation CONFIGURATION_INFORMATION
|
2002-05-31 23:06:46 +00:00
|
|
|
* observed (class/len):
|
1999-03-09 17:47:51 +00:00
|
|
|
* 0x0/0x2c
|
|
|
|
* 0x12/0x18
|
|
|
|
* 0x2/0x138
|
|
|
|
* 0x8/0x600
|
2000-12-06 19:45:07 +00:00
|
|
|
* 0x25/0xc
|
1999-03-09 17:47:51 +00:00
|
|
|
* SystemInformation caller supplies storage for the information structure
|
|
|
|
* Length size of the structure
|
|
|
|
* ResultLength Data written
|
1999-02-13 07:35:31 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtQuerySystemInformation(
|
|
|
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
|
|
|
OUT PVOID SystemInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
OUT PULONG ResultLength)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
2000-12-06 19:45:07 +00:00
|
|
|
switch(SystemInformationClass)
|
|
|
|
{
|
|
|
|
case 0x25:
|
|
|
|
/* Something to do with the size of the registry *
|
|
|
|
* Since we don't have a size limitation, fake it *
|
|
|
|
* This is almost certainly wrong. *
|
|
|
|
* This sets each of the three words in the struct to 32 MB, *
|
|
|
|
* which is enough to make the IE 5 installer happy. */
|
|
|
|
FIXME("(0x%08x,%p,0x%08lx,%p) faking max registry size of 32 MB\n",
|
|
|
|
SystemInformationClass,SystemInformation,Length,ResultLength);
|
|
|
|
*(DWORD *)SystemInformation = 0x2000000;
|
|
|
|
*(((DWORD *)SystemInformation)+1) = 0x200000;
|
|
|
|
*(((DWORD *)SystemInformation)+2) = 0x200000;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
|
2000-12-06 19:45:07 +00:00
|
|
|
SystemInformationClass,SystemInformation,Length,ResultLength);
|
1999-03-09 17:47:51 +00:00
|
|
|
ZeroMemory (SystemInformation, Length);
|
2000-12-06 19:45:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
1998-12-24 14:34:55 +00:00
|
|
|
}
|
|
|
|
|
1998-11-01 14:00:21 +00:00
|
|
|
|
1999-02-13 07:35:31 +00:00
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtCreatePagingFile [NTDLL.@]
|
2001-07-11 18:56:41 +00:00
|
|
|
* ZwCreatePagingFile [NTDLL.@]
|
1999-02-13 07:35:31 +00:00
|
|
|
*/
|
1999-03-09 17:47:51 +00:00
|
|
|
NTSTATUS WINAPI NtCreatePagingFile(
|
|
|
|
IN PUNICODE_STRING PageFileName,
|
|
|
|
IN ULONG MiniumSize,
|
|
|
|
IN ULONG MaxiumSize,
|
|
|
|
OUT PULONG ActualSize)
|
1999-02-13 07:35:31 +00:00
|
|
|
{
|
1999-05-23 10:25:25 +00:00
|
|
|
FIXME("(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
|
1999-04-11 14:53:24 +00:00
|
|
|
PageFileName->Buffer, debugstr_w(PageFileName->Buffer),MiniumSize,MaxiumSize,ActualSize);
|
1999-02-13 07:35:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-04-11 14:53:24 +00:00
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtDisplayString [NTDLL.@]
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1999-04-11 14:53:24 +00:00
|
|
|
* writes a string to the nt-textmode screen eg. during startup
|
|
|
|
*/
|
2000-09-29 00:31:57 +00:00
|
|
|
NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string )
|
1999-04-11 14:53:24 +00:00
|
|
|
{
|
2000-09-29 00:31:57 +00:00
|
|
|
STRING stringA;
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
if (!(ret = RtlUnicodeStringToAnsiString( &stringA, string, TRUE )))
|
|
|
|
{
|
|
|
|
MESSAGE( "%.*s", stringA.Length, stringA.Buffer );
|
|
|
|
RtlFreeAnsiString( &stringA );
|
|
|
|
}
|
|
|
|
return ret;
|
1999-04-11 14:53:24 +00:00
|
|
|
}
|
1999-12-10 03:27:15 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* NtPowerInformation [NTDLL.@]
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1999-12-10 03:27:15 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtPowerInformation(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
|
|
|
|
{
|
|
|
|
FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",x1,x2,x3,x4,x5);
|
|
|
|
return 0;
|
|
|
|
}
|
- 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 22:35:33 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-19 18:20:47 +00:00
|
|
|
* NtAllocateLocallyUniqueId (NTDLL.@)
|
- 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 22:35:33 +00:00
|
|
|
*
|
|
|
|
* FIXME: the server should do that
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid)
|
|
|
|
{
|
2001-11-20 18:52:20 +00:00
|
|
|
static LUID luid;
|
- 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 22:35:33 +00:00
|
|
|
|
2001-11-20 18:52:20 +00:00
|
|
|
FIXME("%p (0x%08lx%08lx)\n", Luid, luid.HighPart, luid.LowPart);
|
- 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 22:35:33 +00:00
|
|
|
|
2001-11-20 18:52:20 +00:00
|
|
|
luid.LowPart++;
|
|
|
|
if (luid.LowPart==0)
|
|
|
|
luid.HighPart++;
|
|
|
|
Luid->HighPart = luid.HighPart;
|
|
|
|
Luid->LowPart = luid.LowPart;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
- 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 22:35:33 +00:00
|
|
|
}
|
2002-05-09 20:30:52 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* VerSetConditionMask (NTDLL.@)
|
|
|
|
*/
|
|
|
|
ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
|
|
|
|
BYTE dwConditionMask)
|
|
|
|
{
|
2002-05-19 22:20:09 +00: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 20:30:52 +00:00
|
|
|
return dwlConditionMask;
|
|
|
|
}
|