1999-03-09 18:47:51 +01:00
|
|
|
/*
|
|
|
|
* registry functions
|
- 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
|
|
|
*
|
|
|
|
* NOTES:
|
|
|
|
* HKEY_LOCAL_MACHINE \\REGISTRY\\MACHINE
|
|
|
|
* HKEY_USERS \\REGISTRY\\USER
|
|
|
|
* HKEY_CURRENT_CONFIG \\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET\\HARDWARE PROFILES\\CURRENT
|
|
|
|
* HKEY_CLASSES \\REGISTRY\\MACHINE\\SOFTWARE\\CLASSES
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
|
1999-05-23 12:25:25 +02:00
|
|
|
#include "debugtools.h"
|
1999-02-13 08:35:31 +01:00
|
|
|
#include "winreg.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 "winerror.h"
|
|
|
|
#include "file.h"
|
|
|
|
#include "server.h"
|
1999-02-13 08:35:31 +01:00
|
|
|
#include "ntddk.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 "crtdll.h"
|
|
|
|
#include "ntdll_misc.h"
|
1999-02-13 08:35:31 +01:00
|
|
|
|
2000-01-24 22:58:06 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(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 23:35:33 +01:00
|
|
|
|
|
|
|
/* copy a key name into the request buffer */
|
|
|
|
static inline NTSTATUS copy_nameU( LPWSTR Dest, PUNICODE_STRING Name, UINT Offset )
|
|
|
|
{
|
|
|
|
if (Name->Buffer)
|
|
|
|
{
|
|
|
|
if ((Name->Length-Offset) > MAX_PATH) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
lstrcpyW( Dest, Name->Buffer+Offset );
|
|
|
|
}
|
|
|
|
else Dest[0] = 0;
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* translates predefined paths to HKEY_ constants */
|
|
|
|
static BOOLEAN _NtKeyToWinKey(
|
|
|
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
OUT UINT * Offset, /* offset within ObjectName */
|
|
|
|
OUT HKEY * KeyHandle) /* translated handle */
|
|
|
|
{
|
|
|
|
static const WCHAR KeyPath_HKLM[] = {
|
|
|
|
'\\','R','E','G','I','S','T','R','Y',
|
|
|
|
'\\','M','A','C','H','I','N','E',0};
|
|
|
|
static const WCHAR KeyPath_HKU [] = {
|
|
|
|
'\\','R','E','G','I','S','T','R','Y',
|
|
|
|
'\\','U','S','E','R',0};
|
|
|
|
static const WCHAR KeyPath_HCC [] = {
|
|
|
|
'\\','R','E','G','I','S','T','R','Y',
|
|
|
|
'\\','M','A','C','H','I','N','E',
|
|
|
|
'\\','S','Y','S','T','E','M',
|
|
|
|
'\\','C','U','R','R','E','N','T','C','O','N','T','R','O','L','S','E','T',
|
|
|
|
'\\','H','A','R','D','W','A','R','E','P','R','O','F','I','L','E','S',
|
|
|
|
'\\','C','U','R','R','E','N','T',0};
|
|
|
|
static const WCHAR KeyPath_HCR [] = {
|
|
|
|
'\\','R','E','G','I','S','T','R','Y',
|
|
|
|
'\\','M','A','C','H','I','N','E',
|
|
|
|
'\\','S','O','F','T','W','A','R','E',
|
|
|
|
'\\','C','L','A','S','S','E','S',0};
|
|
|
|
int len;
|
|
|
|
PUNICODE_STRING ObjectName = ObjectAttributes->ObjectName;
|
2000-02-25 22:37:21 +01:00
|
|
|
|
|
|
|
if(ObjectAttributes->RootDirectory)
|
|
|
|
{
|
|
|
|
len = 0;
|
|
|
|
*KeyHandle = ObjectAttributes->RootDirectory;
|
|
|
|
}
|
|
|
|
else if((ObjectName->Length > (len=lstrlenW(KeyPath_HKLM)))
|
|
|
|
&& (0==CRTDLL__wcsnicmp(ObjectName->Buffer,KeyPath_HKLM,len)))
|
- 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
|
|
|
{ *KeyHandle = HKEY_LOCAL_MACHINE;
|
|
|
|
}
|
|
|
|
else if((ObjectName->Length > (len=lstrlenW(KeyPath_HKU)))
|
2000-02-25 22:37:21 +01:00
|
|
|
&& (0==CRTDLL__wcsnicmp(ObjectName->Buffer,KeyPath_HKU,len)))
|
- 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
|
|
|
{ *KeyHandle = HKEY_USERS;
|
|
|
|
}
|
|
|
|
else if((ObjectName->Length > (len=lstrlenW(KeyPath_HCR)))
|
2000-02-25 22:37:21 +01:00
|
|
|
&& (0==CRTDLL__wcsnicmp(ObjectName->Buffer,KeyPath_HCR,len)))
|
- 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
|
|
|
{ *KeyHandle = HKEY_CLASSES_ROOT;
|
|
|
|
}
|
|
|
|
else if((ObjectName->Length > (len=lstrlenW(KeyPath_HCC)))
|
2000-02-25 22:37:21 +01:00
|
|
|
&& (0==CRTDLL__wcsnicmp(ObjectName->Buffer,KeyPath_HCC,len)))
|
- 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
|
|
|
{ *KeyHandle = HKEY_CURRENT_CONFIG;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-02-25 22:37:21 +01:00
|
|
|
*KeyHandle = 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 23:35:33 +01:00
|
|
|
*Offset = 0;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-02-25 22:37:21 +01:00
|
|
|
if (len > 0 && ObjectName->Buffer[len] == (WCHAR)'\\') len++;
|
- 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
|
|
|
*Offset = len;
|
|
|
|
|
|
|
|
TRACE("off=%u hkey=0x%08x\n", *Offset, *KeyHandle);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-02-13 08:35:31 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* NtCreateKey [NTDLL]
|
|
|
|
* ZwCreateKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtCreateKey(
|
|
|
|
PHANDLE KeyHandle,
|
|
|
|
ACCESS_MASK DesiredAccess,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
ULONG TitleIndex,
|
|
|
|
PUNICODE_STRING Class,
|
|
|
|
ULONG CreateOptions,
|
|
|
|
PULONG Disposition)
|
|
|
|
{
|
- 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
|
|
|
struct create_key_request *req = get_req_buffer();
|
|
|
|
UINT ObjectNameOffset;
|
|
|
|
HKEY RootDirectory;
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(%p,0x%08lx,0x%08lx,%p(%s),0x%08lx,%p)\n",
|
|
|
|
KeyHandle, DesiredAccess, TitleIndex, Class, debugstr_us(Class), CreateOptions, Disposition);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
|
|
|
|
|
|
|
if (!KeyHandle)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
_NtKeyToWinKey(ObjectAttributes, &ObjectNameOffset, &RootDirectory);
|
|
|
|
|
|
|
|
req->parent = RootDirectory;
|
|
|
|
req->access = DesiredAccess;
|
|
|
|
req->options = CreateOptions;
|
|
|
|
req->modif = time(NULL);
|
|
|
|
|
|
|
|
if (copy_nameU( req->name, ObjectAttributes->ObjectName, ObjectNameOffset ) != STATUS_SUCCESS)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
if (Class)
|
|
|
|
{
|
|
|
|
int ClassLen = Class->Length+1;
|
|
|
|
if ( ClassLen*sizeof(WCHAR) > server_remaining(req->class)) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
lstrcpynW( req->class, Class->Buffer, ClassLen);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
req->class[0] = 0x0000;
|
|
|
|
|
2000-01-24 22:58:06 +01:00
|
|
|
if (!(ret = server_call_noerr(REQ_CREATE_KEY)))
|
- 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
|
|
|
{
|
|
|
|
*KeyHandle = req->hkey;
|
|
|
|
if (Disposition) *Disposition = req->created ? REG_CREATED_NEW_KEY : REG_OPENED_EXISTING_KEY;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtOpenKey [NTDLL.129]
|
|
|
|
* ZwOpenKey
|
|
|
|
* OUT PHANDLE KeyHandle (returns 0 when failure)
|
|
|
|
* IN ACCESS_MASK DesiredAccess
|
|
|
|
* IN POBJECT_ATTRIBUTES ObjectAttributes
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtOpenKey(
|
|
|
|
PHANDLE KeyHandle,
|
|
|
|
ACCESS_MASK DesiredAccess,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes)
|
|
|
|
{
|
|
|
|
struct open_key_request *req = get_req_buffer();
|
|
|
|
UINT ObjectNameOffset;
|
|
|
|
HKEY RootDirectory;
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(%p,0x%08lx)\n", KeyHandle, DesiredAccess);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
|
|
|
|
|
|
|
if (!KeyHandle) return STATUS_INVALID_PARAMETER;
|
|
|
|
*KeyHandle = 0;
|
|
|
|
|
|
|
|
_NtKeyToWinKey(ObjectAttributes, &ObjectNameOffset, &RootDirectory);
|
|
|
|
|
|
|
|
req->parent = RootDirectory;
|
|
|
|
req->access = DesiredAccess;
|
|
|
|
|
|
|
|
if (copy_nameU( req->name, ObjectAttributes->ObjectName, ObjectNameOffset ) != STATUS_SUCCESS)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
2000-01-24 22:58:06 +01:00
|
|
|
if (!(ret = server_call_noerr(REQ_OPEN_KEY)))
|
- 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
|
|
|
{
|
|
|
|
*KeyHandle = req->hkey;
|
|
|
|
}
|
|
|
|
return ret;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtDeleteKey [NTDLL]
|
|
|
|
* ZwDeleteKey
|
|
|
|
*/
|
1999-10-24 23:35:16 +02:00
|
|
|
NTSTATUS WINAPI NtDeleteKey(HANDLE KeyHandle)
|
1999-02-13 08:35:31 +01:00
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x) stub!\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtDeleteValueKey [NTDLL]
|
|
|
|
* ZwDeleteValueKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtDeleteValueKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
IN PUNICODE_STRING ValueName)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,%p(%s)) 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 23:35:33 +01:00
|
|
|
KeyHandle, ValueName,debugstr_us(ValueName));
|
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01: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 23:35:33 +01:00
|
|
|
|
1999-02-13 08:35:31 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* NtEnumerateKey [NTDLL]
|
|
|
|
* ZwEnumerateKey
|
- 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
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* the name copied into the buffer is NOT 0-terminated
|
1999-02-13 08:35:31 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtEnumerateKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
ULONG Index,
|
|
|
|
KEY_INFORMATION_CLASS KeyInformationClass,
|
|
|
|
PVOID KeyInformation,
|
|
|
|
ULONG Length,
|
|
|
|
PULONG ResultLength)
|
|
|
|
{
|
- 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
|
|
|
struct enum_key_request *req = get_req_buffer();
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08x,0x%08lx,0x%08x,%p,0x%08lx,%p)\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, Index, KeyInformationClass, KeyInformation, Length, ResultLength);
|
- 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
|
|
|
|
|
|
|
req->hkey = KeyHandle;
|
|
|
|
req->index = Index;
|
2000-01-24 22:58:06 +01:00
|
|
|
if ((ret = server_call_noerr(REQ_ENUM_KEY)) != STATUS_SUCCESS) return ret;
|
- 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
|
|
|
|
|
|
|
switch (KeyInformationClass)
|
|
|
|
{
|
|
|
|
case KeyBasicInformation:
|
|
|
|
{
|
|
|
|
PKEY_BASIC_INFORMATION kbi = KeyInformation;
|
|
|
|
UINT NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
*ResultLength = sizeof(KEY_BASIC_INFORMATION) - sizeof(WCHAR) + NameLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kbi->LastWriteTime, 0);
|
|
|
|
kbi->TitleIndex = 0;
|
|
|
|
kbi->NameLength = NameLength;
|
|
|
|
memcpy (kbi->Name, req->name, NameLength);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyFullInformation:
|
|
|
|
{
|
|
|
|
PKEY_FULL_INFORMATION kfi = KeyInformation;
|
|
|
|
kfi->ClassLength = lstrlenW(req->class) * sizeof(WCHAR);
|
|
|
|
kfi->ClassOffset = (kfi->ClassLength) ?
|
|
|
|
sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR) : 0xffffffff;
|
|
|
|
*ResultLength = sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR) + kfi->ClassLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kfi->LastWriteTime, 0);
|
|
|
|
kfi->TitleIndex = 0;
|
|
|
|
/* kfi->SubKeys = req->subkeys;
|
|
|
|
kfi->MaxNameLength = req->max_subkey;
|
|
|
|
kfi->MaxClassLength = req->max_class;
|
|
|
|
kfi->Values = req->values;
|
|
|
|
kfi->MaxValueNameLen = req->max_value;
|
|
|
|
kfi->MaxValueDataLen = req->max_data;
|
|
|
|
*/
|
|
|
|
FIXME("incomplete\n");
|
|
|
|
if (kfi->ClassLength) memcpy (kfi->Class, req->class, kfi->ClassLength);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyNodeInformation:
|
|
|
|
{
|
|
|
|
PKEY_NODE_INFORMATION kni = KeyInformation;
|
|
|
|
kni->ClassLength = lstrlenW(req->class) * sizeof(WCHAR);
|
|
|
|
kni->NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
kni->ClassOffset = (kni->ClassLength) ?
|
|
|
|
sizeof(KEY_NODE_INFORMATION) - sizeof(WCHAR) + kni->NameLength : 0xffffffff;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_NODE_INFORMATION) - sizeof(WCHAR) + kni->NameLength + kni->ClassLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kni->LastWriteTime, 0);
|
|
|
|
kni->TitleIndex = 0;
|
|
|
|
memcpy (kni->Name, req->name, kni->NameLength);
|
2000-02-26 14:17:55 +01:00
|
|
|
if (kni->ClassLength) memcpy ((char *) KeyInformation + kni->ClassOffset, req->class, kni->ClassLength);
|
- 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
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("KeyInformationClass not implemented\n");
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
TRACE("buf=%lu len=%lu\n", Length, *ResultLength);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryKey [NTDLL]
|
|
|
|
* ZwQueryKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryKey(
|
|
|
|
HANDLE KeyHandle,
|
|
|
|
KEY_INFORMATION_CLASS KeyInformationClass,
|
|
|
|
PVOID KeyInformation,
|
|
|
|
ULONG Length,
|
|
|
|
PULONG ResultLength)
|
|
|
|
{
|
|
|
|
struct query_key_info_request *req = get_req_buffer();
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08x,0x%08x,%p,0x%08lx,%p) stub\n",
|
|
|
|
KeyHandle, KeyInformationClass, KeyInformation, Length, ResultLength);
|
|
|
|
|
|
|
|
req->hkey = KeyHandle;
|
2000-01-24 22:58:06 +01:00
|
|
|
if ((ret = server_call_noerr(REQ_QUERY_KEY_INFO)) != STATUS_SUCCESS) return ret;
|
- 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
|
|
|
|
|
|
|
switch (KeyInformationClass)
|
|
|
|
{
|
|
|
|
case KeyBasicInformation:
|
|
|
|
{
|
|
|
|
PKEY_BASIC_INFORMATION kbi = KeyInformation;
|
|
|
|
UINT NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
*ResultLength = sizeof(KEY_BASIC_INFORMATION) - sizeof(WCHAR) + NameLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kbi->LastWriteTime, 0);
|
|
|
|
kbi->TitleIndex = 0;
|
|
|
|
kbi->NameLength = NameLength;
|
|
|
|
memcpy (kbi->Name, req->name, NameLength);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyFullInformation:
|
|
|
|
{
|
|
|
|
PKEY_FULL_INFORMATION kfi = KeyInformation;
|
|
|
|
kfi->ClassLength = lstrlenW(req->class) * sizeof(WCHAR);
|
|
|
|
kfi->ClassOffset = (kfi->ClassLength) ?
|
|
|
|
sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR) : 0xffffffff;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR) + kfi->ClassLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kfi->LastWriteTime, 0);
|
|
|
|
kfi->TitleIndex = 0;
|
|
|
|
kfi->SubKeys = req->subkeys;
|
|
|
|
kfi->MaxNameLen = req->max_subkey;
|
|
|
|
kfi->MaxClassLen = req->max_class;
|
|
|
|
kfi->Values = req->values;
|
|
|
|
kfi->MaxValueNameLen = req->max_value;
|
|
|
|
kfi->MaxValueDataLen = req->max_data;
|
2000-02-26 14:17:55 +01:00
|
|
|
if(kfi->ClassLength) memcpy ((char *) KeyInformation + kfi->ClassOffset, req->class, kfi->ClassLength);
|
- 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
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyNodeInformation:
|
|
|
|
{
|
|
|
|
PKEY_NODE_INFORMATION kni = KeyInformation;
|
|
|
|
kni->ClassLength = lstrlenW(req->class) * sizeof(WCHAR);
|
|
|
|
kni->NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
kni->ClassOffset = (kni->ClassLength) ?
|
|
|
|
sizeof(KEY_NODE_INFORMATION) - sizeof(WCHAR) + kni->NameLength : 0xffffffff;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_NODE_INFORMATION) - sizeof(WCHAR) + kni->NameLength + kni->ClassLength;
|
|
|
|
if (Length < *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
DOSFS_UnixTimeToFileTime(req->modif, &kni->LastWriteTime, 0);
|
|
|
|
kni->TitleIndex = 0;
|
|
|
|
memcpy (kni->Name, req->name, kni->NameLength);
|
2000-02-26 14:17:55 +01:00
|
|
|
if(kni->ClassLength) memcpy ((char *) KeyInformation + kni->ClassOffset, req->class, kni->ClassLength);
|
- 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
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("KeyInformationClass not implemented\n");
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
return ret;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtEnumerateValueKey [NTDLL]
|
|
|
|
* ZwEnumerateValueKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtEnumerateValueKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
ULONG Index,
|
|
|
|
KEY_VALUE_INFORMATION_CLASS KeyInformationClass,
|
|
|
|
PVOID KeyInformation,
|
|
|
|
ULONG Length,
|
|
|
|
PULONG ResultLength)
|
|
|
|
{
|
- 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
|
|
|
struct enum_key_value_request *req = get_req_buffer();
|
|
|
|
UINT NameLength;
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08x,0x%08lx,0x%08x,%p,0x%08lx,%p)\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, Index, KeyInformationClass, KeyInformation, Length, ResultLength);
|
- 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
|
|
|
|
|
|
|
req->hkey = KeyHandle;
|
|
|
|
req->index = Index;
|
2000-01-24 22:58:06 +01:00
|
|
|
if ((ret = server_call_noerr(REQ_ENUM_KEY_VALUE)) != STATUS_SUCCESS) return ret;
|
- 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
|
|
|
|
|
|
|
switch (KeyInformationClass)
|
|
|
|
{
|
|
|
|
case KeyBasicInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_BASIC_INFORMATION kbi = KeyInformation;
|
|
|
|
|
|
|
|
NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
*ResultLength = sizeof(KEY_VALUE_BASIC_INFORMATION) - sizeof(WCHAR) + NameLength;
|
|
|
|
if (*ResultLength > Length) return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
|
|
|
|
kbi->TitleIndex = 0;
|
|
|
|
kbi->Type = req->type;
|
|
|
|
kbi->NameLength = NameLength;
|
|
|
|
memcpy(kbi->Name, req->name, kbi->NameLength);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyValueFullInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_FULL_INFORMATION kbi = KeyInformation;
|
|
|
|
UINT DataOffset;
|
|
|
|
|
|
|
|
NameLength = lstrlenW(req->name) * sizeof(WCHAR);
|
|
|
|
DataOffset = sizeof(KEY_VALUE_FULL_INFORMATION) - sizeof(WCHAR) + NameLength;
|
|
|
|
*ResultLength = DataOffset + req->len;
|
|
|
|
|
|
|
|
if (*ResultLength > Length) return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
|
|
|
|
kbi->TitleIndex = 0;
|
|
|
|
kbi->Type = req->type;
|
|
|
|
kbi->DataOffset = DataOffset;
|
|
|
|
kbi->DataLength = req->len;
|
|
|
|
kbi->NameLength = NameLength;
|
|
|
|
memcpy(kbi->Name, req->name, kbi->NameLength);
|
|
|
|
memcpy(((LPBYTE)kbi) + DataOffset, req->data, req->len);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyValuePartialInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_PARTIAL_INFORMATION kbi = KeyInformation;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_VALUE_PARTIAL_INFORMATION) - sizeof(WCHAR) + req->len;
|
|
|
|
|
|
|
|
if (*ResultLength > Length) return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
|
|
|
|
kbi->TitleIndex = 0;
|
|
|
|
kbi->Type = req->type;
|
|
|
|
kbi->DataLength = req->len;
|
|
|
|
memcpy(kbi->Data, req->data, req->len);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
}
|
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtFlushKey [NTDLL]
|
|
|
|
* ZwFlushKey
|
|
|
|
*/
|
1999-10-24 23:35:16 +02:00
|
|
|
NTSTATUS WINAPI NtFlushKey(HANDLE KeyHandle)
|
1999-02-13 08:35:31 +01:00
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x) stub!\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtLoadKey [NTDLL]
|
|
|
|
* ZwLoadKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtLoadKey(
|
|
|
|
PHANDLE KeyHandle,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes)
|
|
|
|
{
|
- 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
|
|
|
FIXME("(%p),stub!\n", KeyHandle);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtNotifyChangeKey [NTDLL]
|
|
|
|
* ZwNotifyChangeKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtNotifyChangeKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE KeyHandle,
|
|
|
|
IN HANDLE Event,
|
1999-02-13 08:35:31 +01:00
|
|
|
IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
|
|
|
|
IN PVOID ApcContext OPTIONAL,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
IN ULONG CompletionFilter,
|
|
|
|
IN BOOLEAN Asynchroneous,
|
|
|
|
OUT PVOID ChangeBuffer,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN BOOLEAN WatchSubtree)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,%p,%p,%p,0x%08lx, 0x%08x,%p,0x%08lx,0x%08x) stub!\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, CompletionFilter,
|
|
|
|
Asynchroneous, ChangeBuffer, Length, WatchSubtree);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryMultipleValueKey [NTDLL]
|
|
|
|
* ZwQueryMultipleValueKey
|
|
|
|
*/
|
|
|
|
|
|
|
|
NTSTATUS WINAPI NtQueryMultipleValueKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
PVALENTW ListOfValuesToQuery,
|
|
|
|
ULONG NumberOfItems,
|
|
|
|
PVOID MultipleValueInformation,
|
|
|
|
ULONG Length,
|
|
|
|
PULONG ReturnLength)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,%p,0x%08lx,%p,0x%08lx,%p) stub!\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, ListOfValuesToQuery, NumberOfItems, MultipleValueInformation,
|
|
|
|
Length,ReturnLength);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryValueKey [NTDLL]
|
|
|
|
* ZwQueryValueKey
|
- 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
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* the name in the KeyValueInformation is never set
|
1999-02-13 08:35:31 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryValueKey(
|
- 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
|
|
|
IN HANDLE KeyHandle,
|
|
|
|
IN PUNICODE_STRING ValueName,
|
|
|
|
IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
|
|
|
|
OUT PVOID KeyValueInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
OUT PULONG ResultLength)
|
1999-02-13 08:35:31 +01: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 23:35:33 +01:00
|
|
|
struct get_key_value_request *req = get_req_buffer();
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08x,%s,0x%08x,%p,0x%08lx,%p)\n",
|
|
|
|
KeyHandle, debugstr_us(ValueName), KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
|
|
|
|
|
|
|
|
req->hkey = KeyHandle;
|
|
|
|
if (copy_nameU(req->name, ValueName, 0) != STATUS_SUCCESS) return STATUS_BUFFER_OVERFLOW;
|
2000-01-24 22:58:06 +01:00
|
|
|
if ((ret = server_call_noerr(REQ_GET_KEY_VALUE)) != STATUS_SUCCESS) return ret;
|
- 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
|
|
|
|
|
|
|
switch(KeyValueInformationClass)
|
|
|
|
{
|
|
|
|
case KeyValueBasicInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_BASIC_INFORMATION kbi = (PKEY_VALUE_BASIC_INFORMATION) KeyValueInformation;
|
|
|
|
kbi->Type = req->type;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_VALUE_BASIC_INFORMATION)-sizeof(WCHAR);
|
|
|
|
if (Length <= *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
kbi->NameLength = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyValueFullInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_FULL_INFORMATION kfi = (PKEY_VALUE_FULL_INFORMATION) KeyValueInformation;
|
|
|
|
ULONG DataOffset;
|
|
|
|
kfi->Type = req->type;
|
|
|
|
|
|
|
|
DataOffset = sizeof(KEY_VALUE_FULL_INFORMATION)-sizeof(WCHAR);
|
|
|
|
*ResultLength = DataOffset + req->len;
|
|
|
|
if (Length <= *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
kfi->NameLength = 0;
|
|
|
|
kfi->DataOffset = DataOffset;
|
|
|
|
kfi->DataLength = req->len;
|
2000-02-26 14:17:55 +01:00
|
|
|
memcpy((char *) KeyValueInformation + DataOffset, req->data, req->len);
|
- 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
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyValuePartialInformation:
|
|
|
|
{
|
|
|
|
PKEY_VALUE_PARTIAL_INFORMATION kpi = (PKEY_VALUE_PARTIAL_INFORMATION) KeyValueInformation;
|
|
|
|
kpi->Type = req->type;
|
|
|
|
|
|
|
|
*ResultLength = sizeof(KEY_VALUE_FULL_INFORMATION)-sizeof(UCHAR)+req->len;
|
|
|
|
if (Length <= *ResultLength) return STATUS_BUFFER_OVERFLOW;
|
|
|
|
|
|
|
|
kpi->DataLength = req->len;
|
|
|
|
memcpy(kpi->Data, req->data, req->len);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("KeyValueInformationClass not implemented\n");
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
|
|
|
|
}
|
|
|
|
return ret;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtReplaceKey [NTDLL]
|
|
|
|
* ZwReplaceKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtReplaceKey(
|
|
|
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE Key,
|
1999-02-13 08:35:31 +01:00
|
|
|
IN POBJECT_ATTRIBUTES ReplacedObjectAttributes)
|
|
|
|
{
|
- 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
|
|
|
FIXME("(0x%08x),stub!\n", Key);
|
|
|
|
dump_ObjectAttributes(ObjectAttributes);
|
|
|
|
dump_ObjectAttributes(ReplacedObjectAttributes);
|
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* NtRestoreKey [NTDLL]
|
|
|
|
* ZwRestoreKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtRestoreKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE KeyHandle,
|
|
|
|
HANDLE FileHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
ULONG RestoreFlags)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,0x%08lx) stub\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, FileHandle, RestoreFlags);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* NtSaveKey [NTDLL]
|
|
|
|
* ZwSaveKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSaveKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE KeyHandle,
|
|
|
|
IN HANDLE FileHandle)
|
1999-02-13 08:35:31 +01:00
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x) stub\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, FileHandle);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* NtSetInformationKey [NTDLL]
|
|
|
|
* ZwSetInformationKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetInformationKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
IN const int KeyInformationClass,
|
|
|
|
IN PVOID KeyInformation,
|
|
|
|
IN ULONG KeyInformationLength)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,%p,0x%08lx) stub\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle, KeyInformationClass, KeyInformation, KeyInformationLength);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* NtSetValueKey [NTDLL]
|
|
|
|
* ZwSetValueKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetValueKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE KeyHandle,
|
1999-02-13 08:35:31 +01:00
|
|
|
PUNICODE_STRING ValueName,
|
|
|
|
ULONG TitleIndex,
|
|
|
|
ULONG Type,
|
|
|
|
PVOID Data,
|
|
|
|
ULONG DataSize)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,%p(%s), 0x%08lx, 0x%08lx, %p, 0x%08lx) 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 23:35:33 +01:00
|
|
|
KeyHandle, ValueName,debugstr_us(ValueName), TitleIndex, Type, Data, DataSize);
|
|
|
|
return STATUS_SUCCESS;
|
1999-02-13 08:35:31 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtUnloadKey [NTDLL]
|
|
|
|
* ZwUnloadKey
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtUnloadKey(
|
1999-02-26 12:11:13 +01:00
|
|
|
IN HANDLE KeyHandle)
|
1999-02-13 08:35:31 +01:00
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x) stub\n",
|
1999-02-13 08:35:31 +01:00
|
|
|
KeyHandle);
|
- 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
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* RtlFormatCurrentUserKeyPath [NTDLL.371]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(
|
|
|
|
IN OUT PUNICODE_STRING KeyPath)
|
|
|
|
{
|
|
|
|
/* LPSTR Path = "\\REGISTRY\\USER\\S-1-5-21-0000000000-000000000-0000000000-500";*/
|
|
|
|
LPSTR Path = "\\REGISTRY\\USER\\.DEFAULT";
|
|
|
|
ANSI_STRING AnsiPath;
|
|
|
|
|
|
|
|
FIXME("(%p) stub\n",KeyPath);
|
|
|
|
RtlInitAnsiString(&AnsiPath, Path);
|
|
|
|
return RtlAnsiStringToUnicodeString(KeyPath, &AnsiPath, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* RtlOpenCurrentUser [NTDLL]
|
|
|
|
*
|
|
|
|
* if we return just HKEY_CURRENT_USER the advapi try's to find a remote
|
|
|
|
* registry (odd handle) and fails
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
DWORD WINAPI RtlOpenCurrentUser(
|
|
|
|
IN ACCESS_MASK DesiredAccess,
|
|
|
|
OUT PHANDLE KeyHandle) /* handle of HKEY_CURRENT_USER */
|
|
|
|
{
|
|
|
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
|
|
UNICODE_STRING ObjectName;
|
|
|
|
NTSTATUS ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08lx, %p) stub\n",DesiredAccess, KeyHandle);
|
|
|
|
|
|
|
|
RtlFormatCurrentUserKeyPath(&ObjectName);
|
|
|
|
InitializeObjectAttributes(&ObjectAttributes,&ObjectName,OBJ_CASE_INSENSITIVE,0, NULL);
|
|
|
|
ret = NtOpenKey(KeyHandle, DesiredAccess, &ObjectAttributes);
|
|
|
|
RtlFreeUnicodeString(&ObjectName);
|
|
|
|
return ret;
|
1999-02-13 08:35:31 +01:00
|
|
|
}
|