mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Make RtlpGetRegistryHandle() a local helper function.
svn path=/trunk/; revision=6331
This commit is contained in:
parent
ba15abe412
commit
194a827c38
4 changed files with 132 additions and 174 deletions
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
RtlpGetRegistryHandle(ULONG RelativeTo,
|
|
||||||
PWSTR Path,
|
|
||||||
BOOLEAN Create,
|
|
||||||
PHANDLE KeyHandle);
|
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _NTOS_H
|
#ifndef _NTOS_H
|
||||||
#define _NTOS_H
|
#define _NTOS_H
|
||||||
/* $Id: ntos.h,v 1.16 2003/08/27 21:21:59 dwelch Exp $ */
|
/* $Id: ntos.h,v 1.17 2003/10/15 21:15:18 ekohl Exp $ */
|
||||||
|
|
||||||
#if defined(NTOS_MODE_USER)
|
#if defined(NTOS_MODE_USER)
|
||||||
/*
|
/*
|
||||||
|
@ -45,7 +45,6 @@
|
||||||
#include "ntdll/csr.h"
|
#include "ntdll/csr.h"
|
||||||
#include "ntdll/dbg.h"
|
#include "ntdll/dbg.h"
|
||||||
#include "ntdll/ldr.h"
|
#include "ntdll/ldr.h"
|
||||||
#include "ntdll/registry.h"
|
|
||||||
#include "ntdll/rtl.h"
|
#include "ntdll/rtl.h"
|
||||||
#include "ntdll/trace.h"
|
#include "ntdll/trace.h"
|
||||||
#include "rosrtl/thread.h"
|
#include "rosrtl/thread.h"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: registry.c,v 1.24 2003/08/30 14:47:36 hbirr Exp $
|
/* $Id: registry.c,v 1.25 2003/10/15 21:14:01 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <ntdll/rtl.h>
|
#include <ntdll/rtl.h>
|
||||||
#include <ntdll/registry.h>
|
|
||||||
#include <ntos/minmax.h>
|
#include <ntos/minmax.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -30,6 +29,120 @@
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
|
static NTSTATUS
|
||||||
|
RtlpGetRegistryHandle(ULONG RelativeTo,
|
||||||
|
PWSTR Path,
|
||||||
|
BOOLEAN Create,
|
||||||
|
PHANDLE KeyHandle)
|
||||||
|
{
|
||||||
|
UNICODE_STRING KeyName;
|
||||||
|
WCHAR KeyBuffer[MAX_PATH];
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
DPRINT("RtlpGetRegistryHandle()\n");
|
||||||
|
|
||||||
|
if (RelativeTo & RTL_REGISTRY_HANDLE)
|
||||||
|
{
|
||||||
|
Status = NtDuplicateObject(NtCurrentProcess(),
|
||||||
|
(HANDLE)Path,
|
||||||
|
NtCurrentProcess(),
|
||||||
|
KeyHandle,
|
||||||
|
0,
|
||||||
|
FALSE,
|
||||||
|
DUPLICATE_SAME_ACCESS);
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RelativeTo & RTL_REGISTRY_OPTIONAL)
|
||||||
|
RelativeTo &= ~RTL_REGISTRY_OPTIONAL;
|
||||||
|
|
||||||
|
if (RelativeTo >= RTL_REGISTRY_MAXIMUM)
|
||||||
|
return(STATUS_INVALID_PARAMETER);
|
||||||
|
|
||||||
|
KeyName.Length = 0;
|
||||||
|
KeyName.MaximumLength = MAX_PATH;
|
||||||
|
KeyName.Buffer = KeyBuffer;
|
||||||
|
KeyBuffer[0] = 0;
|
||||||
|
|
||||||
|
switch (RelativeTo)
|
||||||
|
{
|
||||||
|
case RTL_REGISTRY_ABSOLUTE:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RTL_REGISTRY_SERVICES:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RTL_REGISTRY_CONTROL:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RTL_REGISTRY_WINDOWS_NT:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RTL_REGISTRY_DEVICEMAP:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\Hardware\\DeviceMap\\");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RTL_REGISTRY_USER:
|
||||||
|
Status = RtlFormatCurrentUserKeyPath(&KeyName);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return(Status);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* ReactOS specific */
|
||||||
|
case RTL_REGISTRY_ENUM:
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("KeyName %wZ\n", &KeyName);
|
||||||
|
|
||||||
|
if (Path[0] == L'\\' && RelativeTo != RTL_REGISTRY_ABSOLUTE)
|
||||||
|
{
|
||||||
|
Path++;
|
||||||
|
}
|
||||||
|
RtlAppendUnicodeToString(&KeyName,
|
||||||
|
Path);
|
||||||
|
|
||||||
|
DPRINT("KeyName %wZ\n", &KeyName);
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&KeyName,
|
||||||
|
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (Create == TRUE)
|
||||||
|
{
|
||||||
|
Status = NtCreateKey(KeyHandle,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = NtOpenKey(KeyHandle,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -927,120 +1040,4 @@ RtlpNtSetValueKey(IN HANDLE KeyHandle,
|
||||||
DataLength));
|
DataLength));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* INTERNAL FUNCTIONS ******************************************************/
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
RtlpGetRegistryHandle(ULONG RelativeTo,
|
|
||||||
PWSTR Path,
|
|
||||||
BOOLEAN Create,
|
|
||||||
PHANDLE KeyHandle)
|
|
||||||
{
|
|
||||||
UNICODE_STRING KeyName;
|
|
||||||
WCHAR KeyBuffer[MAX_PATH];
|
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
DPRINT("RtlpGetRegistryHandle()\n");
|
|
||||||
|
|
||||||
if (RelativeTo & RTL_REGISTRY_HANDLE)
|
|
||||||
{
|
|
||||||
Status = NtDuplicateObject(NtCurrentProcess(),
|
|
||||||
(HANDLE)Path,
|
|
||||||
NtCurrentProcess(),
|
|
||||||
KeyHandle,
|
|
||||||
0,
|
|
||||||
FALSE,
|
|
||||||
DUPLICATE_SAME_ACCESS);
|
|
||||||
return(Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RelativeTo & RTL_REGISTRY_OPTIONAL)
|
|
||||||
RelativeTo &= ~RTL_REGISTRY_OPTIONAL;
|
|
||||||
|
|
||||||
if (RelativeTo >= RTL_REGISTRY_MAXIMUM)
|
|
||||||
return(STATUS_INVALID_PARAMETER);
|
|
||||||
|
|
||||||
KeyName.Length = 0;
|
|
||||||
KeyName.MaximumLength = MAX_PATH;
|
|
||||||
KeyName.Buffer = KeyBuffer;
|
|
||||||
KeyBuffer[0] = 0;
|
|
||||||
|
|
||||||
switch (RelativeTo)
|
|
||||||
{
|
|
||||||
case RTL_REGISTRY_ABSOLUTE:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RTL_REGISTRY_SERVICES:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RTL_REGISTRY_CONTROL:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RTL_REGISTRY_WINDOWS_NT:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RTL_REGISTRY_DEVICEMAP:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\Registry\\Machine\\Hardware\\DeviceMap\\");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RTL_REGISTRY_USER:
|
|
||||||
Status = RtlFormatCurrentUserKeyPath(&KeyName);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
return(Status);
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* ReactOS specific */
|
|
||||||
case RTL_REGISTRY_ENUM:
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("KeyName %wZ\n", &KeyName);
|
|
||||||
|
|
||||||
if (Path[0] == L'\\' && RelativeTo != RTL_REGISTRY_ABSOLUTE)
|
|
||||||
{
|
|
||||||
Path++;
|
|
||||||
}
|
|
||||||
RtlAppendUnicodeToString(&KeyName,
|
|
||||||
Path);
|
|
||||||
|
|
||||||
DPRINT("KeyName %wZ\n", &KeyName);
|
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
|
||||||
&KeyName,
|
|
||||||
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
|
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (Create == TRUE)
|
|
||||||
{
|
|
||||||
Status = NtCreateKey(KeyHandle,
|
|
||||||
KEY_ALL_ACCESS,
|
|
||||||
&ObjectAttributes,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Status = NtOpenKey(KeyHandle,
|
|
||||||
KEY_ALL_ACCESS,
|
|
||||||
&ObjectAttributes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: timezone.c,v 1.6 2003/09/12 17:51:48 vizzini Exp $
|
/* $Id: timezone.c,v 1.7 2003/10/15 21:14:01 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <ntdll/ntdll.h>
|
#include <ntdll/ntdll.h>
|
||||||
#include <ntdll/registry.h>
|
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -28,7 +27,6 @@
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
{
|
{
|
||||||
HANDLE KeyHandle;
|
|
||||||
RTL_QUERY_REGISTRY_TABLE QueryTable[8];
|
RTL_QUERY_REGISTRY_TABLE QueryTable[8];
|
||||||
UNICODE_STRING StandardName;
|
UNICODE_STRING StandardName;
|
||||||
UNICODE_STRING DaylightName;
|
UNICODE_STRING DaylightName;
|
||||||
|
@ -36,16 +34,6 @@ RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
|
|
||||||
DPRINT("RtlQueryTimeZoneInformation()\n");
|
DPRINT("RtlQueryTimeZoneInformation()\n");
|
||||||
|
|
||||||
Status = RtlpGetRegistryHandle(RTL_REGISTRY_CONTROL,
|
|
||||||
L"TimeZoneInformation",
|
|
||||||
TRUE,
|
|
||||||
&KeyHandle);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT("RtlpGetRegistryHandle failed (Status %x)\n", Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
RtlZeroMemory(QueryTable,
|
RtlZeroMemory(QueryTable,
|
||||||
sizeof(QueryTable));
|
sizeof(QueryTable));
|
||||||
|
|
||||||
|
@ -85,12 +73,11 @@ RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
QueryTable[6].Flags = RTL_QUERY_REGISTRY_DIRECT;
|
QueryTable[6].Flags = RTL_QUERY_REGISTRY_DIRECT;
|
||||||
QueryTable[6].EntryContext = &TimeZoneInformation->DaylightDate;
|
QueryTable[6].EntryContext = &TimeZoneInformation->DaylightDate;
|
||||||
|
|
||||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
|
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
QueryTable,
|
QueryTable,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
NtClose(KeyHandle);
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -102,105 +89,86 @@ RtlQueryTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
RtlSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
RtlSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
{
|
{
|
||||||
HANDLE KeyHandle;
|
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("RtlSetTimeZoneInformation()\n");
|
DPRINT("RtlSetTimeZoneInformation()\n");
|
||||||
|
|
||||||
Status = RtlpGetRegistryHandle(RTL_REGISTRY_CONTROL,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
L"TimeZoneInformation",
|
L"TimeZoneInformation",
|
||||||
TRUE,
|
|
||||||
&KeyHandle);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT("RtlpGetRegistryHandle failed (Status %x)\n", Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
|
||||||
(PWSTR)KeyHandle,
|
|
||||||
L"Bias",
|
L"Bias",
|
||||||
REG_DWORD,
|
REG_DWORD,
|
||||||
&TimeZoneInformation->Bias,
|
&TimeZoneInformation->Bias,
|
||||||
sizeof(LONG));
|
sizeof(LONG));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Length = (wcslen(TimeZoneInformation->StandardName) + 1) * sizeof(WCHAR);
|
Length = (wcslen(TimeZoneInformation->StandardName) + 1) * sizeof(WCHAR);
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Standard Name",
|
L"Standard Name",
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
TimeZoneInformation->StandardName,
|
TimeZoneInformation->StandardName,
|
||||||
Length);
|
Length);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Standard Bias",
|
L"Standard Bias",
|
||||||
REG_DWORD,
|
REG_DWORD,
|
||||||
&TimeZoneInformation->StandardBias,
|
&TimeZoneInformation->StandardBias,
|
||||||
sizeof(LONG));
|
sizeof(LONG));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Standard Start",
|
L"Standard Start",
|
||||||
REG_BINARY,
|
REG_BINARY,
|
||||||
&TimeZoneInformation->StandardDate,
|
&TimeZoneInformation->StandardDate,
|
||||||
sizeof(SYSTEMTIME));
|
sizeof(SYSTEMTIME));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Length = (wcslen(TimeZoneInformation->DaylightName) + 1) * sizeof(WCHAR);
|
Length = (wcslen(TimeZoneInformation->DaylightName) + 1) * sizeof(WCHAR);
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Daylight Name",
|
L"Daylight Name",
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
TimeZoneInformation->DaylightName,
|
TimeZoneInformation->DaylightName,
|
||||||
Length);
|
Length);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Daylight Bias",
|
L"Daylight Bias",
|
||||||
REG_DWORD,
|
REG_DWORD,
|
||||||
&TimeZoneInformation->DaylightBias,
|
&TimeZoneInformation->DaylightBias,
|
||||||
sizeof(LONG));
|
sizeof(LONG));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
|
||||||
(PWSTR)KeyHandle,
|
L"TimeZoneInformation",
|
||||||
L"Daylight Start",
|
L"Daylight Start",
|
||||||
REG_BINARY,
|
REG_BINARY,
|
||||||
&TimeZoneInformation->DaylightDate,
|
&TimeZoneInformation->DaylightDate,
|
||||||
sizeof(SYSTEMTIME));
|
sizeof(SYSTEMTIME));
|
||||||
|
|
||||||
NtClose(KeyHandle);
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue