mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 17:21:23 +00:00
- Formatting fix. No code change
svn path=/trunk/; revision=38688
This commit is contained in:
parent
faff43dadc
commit
a7f8cd9375
1 changed files with 247 additions and 241 deletions
|
@ -34,10 +34,13 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
static
|
||||||
|
BOOL
|
||||||
|
GetComputerNameFromRegistry(LPWSTR RegistryKey,
|
||||||
LPWSTR ValueNameStr,
|
LPWSTR ValueNameStr,
|
||||||
LPWSTR lpBuffer,
|
LPWSTR lpBuffer,
|
||||||
LPDWORD nSize ) {
|
LPDWORD nSize )
|
||||||
|
{
|
||||||
PKEY_VALUE_PARTIAL_INFORMATION KeyInfo;
|
PKEY_VALUE_PARTIAL_INFORMATION KeyInfo;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING KeyName;
|
UNICODE_STRING KeyName;
|
||||||
|
@ -53,6 +56,7 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = ZwOpenKey(&KeyHandle,
|
Status = ZwOpenKey(&KeyHandle,
|
||||||
KEY_READ,
|
KEY_READ,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
|
@ -62,11 +66,8 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) +
|
KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + *nSize * sizeof(WCHAR);
|
||||||
*nSize * sizeof(WCHAR);
|
KeyInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, KeyInfoSize);
|
||||||
KeyInfo = RtlAllocateHeap (RtlGetProcessHeap (),
|
|
||||||
0,
|
|
||||||
KeyInfoSize);
|
|
||||||
if (KeyInfo == NULL)
|
if (KeyInfo == NULL)
|
||||||
{
|
{
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
|
@ -84,27 +85,22 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
||||||
&ReturnSize);
|
&ReturnSize);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
RtlFreeHeap (RtlGetProcessHeap (),
|
RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo);
|
||||||
0,
|
|
||||||
KeyInfo);
|
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
*nSize = ReturnSize;
|
*nSize = ReturnSize;
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) {
|
if (*nSize > (KeyInfo->DataLength / sizeof(WCHAR)))
|
||||||
|
{
|
||||||
*nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
|
*nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
|
||||||
lpBuffer[*nSize] = 0;
|
lpBuffer[*nSize] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCopyMemory (lpBuffer,
|
RtlCopyMemory(lpBuffer, KeyInfo->Data, *nSize * sizeof(WCHAR));
|
||||||
KeyInfo->Data,
|
|
||||||
*nSize * sizeof(WCHAR));
|
|
||||||
|
|
||||||
RtlFreeHeap (RtlGetProcessHeap (),
|
RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo);
|
||||||
0,
|
|
||||||
KeyInfo);
|
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -113,12 +109,11 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
GetComputerNameExW (
|
WINAPI
|
||||||
COMPUTER_NAME_FORMAT NameType,
|
GetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
|
||||||
LPWSTR lpBuffer,
|
LPWSTR lpBuffer,
|
||||||
LPDWORD nSize
|
LPDWORD nSize)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNICODE_STRING ResultString;
|
UNICODE_STRING ResultString;
|
||||||
UNICODE_STRING DomainPart;
|
UNICODE_STRING DomainPart;
|
||||||
|
@ -127,18 +122,17 @@ GetComputerNameExW (
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
DWORD HostSize;
|
DWORD HostSize;
|
||||||
|
|
||||||
switch( NameType ) {
|
switch (NameType)
|
||||||
|
{
|
||||||
case ComputerNameNetBIOS:
|
case ComputerNameNetBIOS:
|
||||||
return GetComputerNameFromRegistry
|
return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Control\\ComputerName\\ComputerName",
|
L"\\Control\\ComputerName\\ComputerName",
|
||||||
L"ComputerName",
|
L"ComputerName",
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
nSize);
|
nSize);
|
||||||
|
|
||||||
case ComputerNameDnsDomain:
|
case ComputerNameDnsDomain:
|
||||||
return GetComputerNameFromRegistry
|
return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Services\\Tcpip\\Parameters",
|
L"\\Services\\Tcpip\\Parameters",
|
||||||
L"Domain",
|
L"Domain",
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
|
@ -151,6 +145,7 @@ GetComputerNameExW (
|
||||||
|
|
||||||
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
||||||
RtlInitUnicodeString(&DomainPart, NULL);
|
RtlInitUnicodeString(&DomainPart, NULL);
|
||||||
|
|
||||||
QueryTable[0].Name = L"HostName";
|
QueryTable[0].Name = L"HostName";
|
||||||
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
|
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
|
||||||
QueryTable[0].EntryContext = &DomainPart;
|
QueryTable[0].EntryContext = &DomainPart;
|
||||||
|
@ -159,14 +154,20 @@ GetComputerNameExW (
|
||||||
L"\\Registry\\Machine\\System"
|
L"\\Registry\\Machine\\System"
|
||||||
L"\\CurrentControlSet\\Services\\Tcpip"
|
L"\\CurrentControlSet\\Services\\Tcpip"
|
||||||
L"\\Parameters",
|
L"\\Parameters",
|
||||||
QueryTable, NULL, NULL);
|
QueryTable,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if( NT_SUCCESS(Status) ) {
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
Status = RtlAppendUnicodeStringToString(&ResultString, &DomainPart);
|
Status = RtlAppendUnicodeStringToString(&ResultString, &DomainPart);
|
||||||
HostSize = DomainPart.Length;
|
HostSize = DomainPart.Length;
|
||||||
if (!NT_SUCCESS(Status)) {
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlAppendUnicodeToString(&ResultString, L".");
|
RtlAppendUnicodeToString(&ResultString, L".");
|
||||||
RtlFreeUnicodeString(&DomainPart);
|
RtlFreeUnicodeString(&DomainPart);
|
||||||
|
|
||||||
|
@ -179,11 +180,15 @@ GetComputerNameExW (
|
||||||
L"\\Registry\\Machine\\System"
|
L"\\Registry\\Machine\\System"
|
||||||
L"\\CurrentControlSet\\Services\\Tcpip"
|
L"\\CurrentControlSet\\Services\\Tcpip"
|
||||||
L"\\Parameters",
|
L"\\Parameters",
|
||||||
QueryTable, NULL, NULL);
|
QueryTable,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if( NT_SUCCESS(Status) ) {
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
Status = RtlAppendUnicodeStringToString(&ResultString, &DomainPart);
|
Status = RtlAppendUnicodeStringToString(&ResultString, &DomainPart);
|
||||||
if ( (!NT_SUCCESS(Status)) || (!ret)) {
|
if ((!NT_SUCCESS(Status)) || (!ret))
|
||||||
|
{
|
||||||
*nSize = HostSize + DomainPart.Length;
|
*nSize = HostSize + DomainPart.Length;
|
||||||
SetLastError(ERROR_MORE_DATA);
|
SetLastError(ERROR_MORE_DATA);
|
||||||
RtlFreeUnicodeString(&DomainPart);
|
RtlFreeUnicodeString(&DomainPart);
|
||||||
|
@ -197,16 +202,14 @@ GetComputerNameExW (
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case ComputerNameDnsHostname:
|
case ComputerNameDnsHostname:
|
||||||
return GetComputerNameFromRegistry
|
return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Services\\Tcpip\\Parameters",
|
L"\\Services\\Tcpip\\Parameters",
|
||||||
L"Hostname",
|
L"Hostname",
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
nSize);
|
nSize);
|
||||||
|
|
||||||
case ComputerNamePhysicalDnsDomain:
|
case ComputerNamePhysicalDnsDomain:
|
||||||
return GetComputerNameFromRegistry
|
return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Services\\Tcpip\\Parameters",
|
L"\\Services\\Tcpip\\Parameters",
|
||||||
L"Domain",
|
L"Domain",
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
|
@ -215,13 +218,18 @@ GetComputerNameExW (
|
||||||
/* XXX Redo these */
|
/* XXX Redo these */
|
||||||
case ComputerNamePhysicalDnsFullyQualified:
|
case ComputerNamePhysicalDnsFullyQualified:
|
||||||
return GetComputerNameExW(ComputerNameDnsFullyQualified,
|
return GetComputerNameExW(ComputerNameDnsFullyQualified,
|
||||||
lpBuffer, nSize );
|
lpBuffer,
|
||||||
|
nSize);
|
||||||
|
|
||||||
case ComputerNamePhysicalDnsHostname:
|
case ComputerNamePhysicalDnsHostname:
|
||||||
return GetComputerNameExW(ComputerNameDnsHostname,
|
return GetComputerNameExW(ComputerNameDnsHostname,
|
||||||
lpBuffer, nSize );
|
lpBuffer,
|
||||||
|
nSize);
|
||||||
|
|
||||||
case ComputerNamePhysicalNetBIOS:
|
case ComputerNamePhysicalNetBIOS:
|
||||||
return GetComputerNameExW(ComputerNameNetBIOS,
|
return GetComputerNameExW(ComputerNameNetBIOS,
|
||||||
lpBuffer, nSize );
|
lpBuffer,
|
||||||
|
nSize);
|
||||||
|
|
||||||
case ComputerNameMax:
|
case ComputerNameMax:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -235,18 +243,17 @@ GetComputerNameExW (
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
GetComputerNameExA (
|
GetComputerNameExA(COMPUTER_NAME_FORMAT NameType,
|
||||||
COMPUTER_NAME_FORMAT NameType,
|
|
||||||
LPSTR lpBuffer,
|
LPSTR lpBuffer,
|
||||||
LPDWORD nSize
|
LPDWORD nSize)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNICODE_STRING UnicodeString;
|
UNICODE_STRING UnicodeString;
|
||||||
ANSI_STRING AnsiString;
|
ANSI_STRING AnsiString;
|
||||||
BOOL Result;
|
BOOL Result;
|
||||||
PWCHAR TempBuffer = RtlAllocateHeap( RtlGetProcessHeap(), 0, *nSize * sizeof(WCHAR) );
|
PWCHAR TempBuffer = RtlAllocateHeap( RtlGetProcessHeap(), 0, *nSize * sizeof(WCHAR) );
|
||||||
|
|
||||||
if( !TempBuffer ) {
|
if (!TempBuffer)
|
||||||
|
{
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +263,8 @@ GetComputerNameExA (
|
||||||
|
|
||||||
Result = GetComputerNameExW(NameType, TempBuffer, nSize);
|
Result = GetComputerNameExW(NameType, TempBuffer, nSize);
|
||||||
|
|
||||||
if( Result ) {
|
if (Result)
|
||||||
|
{
|
||||||
UnicodeString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR) + sizeof(WCHAR);
|
UnicodeString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR) + sizeof(WCHAR);
|
||||||
UnicodeString.Length = (USHORT)*nSize * sizeof(WCHAR) + sizeof(WCHAR);
|
UnicodeString.Length = (USHORT)*nSize * sizeof(WCHAR) + sizeof(WCHAR);
|
||||||
UnicodeString.Buffer = TempBuffer;
|
UnicodeString.Buffer = TempBuffer;
|
||||||
|
@ -274,9 +282,9 @@ GetComputerNameExA (
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
GetComputerNameA (LPSTR lpBuffer,
|
WINAPI
|
||||||
LPDWORD lpnSize)
|
GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
|
||||||
{
|
{
|
||||||
return GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
return GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
||||||
}
|
}
|
||||||
|
@ -285,9 +293,9 @@ GetComputerNameA (LPSTR lpBuffer,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
GetComputerNameW (LPWSTR lpBuffer,
|
WINAPI
|
||||||
LPDWORD lpnSize)
|
GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
|
||||||
{
|
{
|
||||||
return GetComputerNameExW(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
return GetComputerNameExW(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
||||||
}
|
}
|
||||||
|
@ -296,9 +304,9 @@ GetComputerNameW (LPWSTR lpBuffer,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
static BOOL
|
static
|
||||||
IsValidComputerName (
|
BOOL
|
||||||
COMPUTER_NAME_FORMAT NameType,
|
IsValidComputerName(COMPUTER_NAME_FORMAT NameType,
|
||||||
LPCWSTR lpComputerName)
|
LPCWSTR lpComputerName)
|
||||||
{
|
{
|
||||||
PWCHAR p;
|
PWCHAR p;
|
||||||
|
@ -308,6 +316,7 @@ IsValidComputerName (
|
||||||
|
|
||||||
Length = 0;
|
Length = 0;
|
||||||
p = (PWCHAR)lpComputerName;
|
p = (PWCHAR)lpComputerName;
|
||||||
|
|
||||||
while (*p != 0)
|
while (*p != 0)
|
||||||
{
|
{
|
||||||
if (!(iswctype(*p, _ALPHA | _DIGIT) || *p == L'!' || *p == L'@' || *p == L'#' ||
|
if (!(iswctype(*p, _ALPHA | _DIGIT) || *p == L'!' || *p == L'@' || *p == L'#' ||
|
||||||
|
@ -320,16 +329,16 @@ IsValidComputerName (
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Length == 0 ||
|
if (Length == 0 || Length > MAX_COMPUTERNAME_LENGTH)
|
||||||
Length > MAX_COMPUTERNAME_LENGTH)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL SetComputerNameToRegistry(
|
static
|
||||||
LPCWSTR RegistryKey,
|
BOOL
|
||||||
|
SetComputerNameToRegistry(LPCWSTR RegistryKey,
|
||||||
LPCWSTR ValueNameStr,
|
LPCWSTR ValueNameStr,
|
||||||
LPCWSTR lpBuffer)
|
LPCWSTR lpBuffer)
|
||||||
{
|
{
|
||||||
|
@ -380,7 +389,8 @@ static BOOL SetComputerNameToRegistry(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
|
WINAPI
|
||||||
SetComputerNameA(LPCSTR lpComputerName)
|
SetComputerNameA(LPCSTR lpComputerName)
|
||||||
{
|
{
|
||||||
return SetComputerNameExA(ComputerNamePhysicalNetBIOS, lpComputerName);
|
return SetComputerNameExA(ComputerNamePhysicalNetBIOS, lpComputerName);
|
||||||
|
@ -390,7 +400,8 @@ SetComputerNameA (LPCSTR lpComputerName)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
|
WINAPI
|
||||||
SetComputerNameW(LPCWSTR lpComputerName)
|
SetComputerNameW(LPCWSTR lpComputerName)
|
||||||
{
|
{
|
||||||
return SetComputerNameExW(ComputerNamePhysicalNetBIOS, lpComputerName);
|
return SetComputerNameExW(ComputerNamePhysicalNetBIOS, lpComputerName);
|
||||||
|
@ -400,16 +411,15 @@ SetComputerNameW (LPCWSTR lpComputerName)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
SetComputerNameExA (
|
WINAPI
|
||||||
COMPUTER_NAME_FORMAT NameType,
|
SetComputerNameExA(COMPUTER_NAME_FORMAT NameType,
|
||||||
LPCSTR lpBuffer)
|
LPCSTR lpBuffer)
|
||||||
{
|
{
|
||||||
UNICODE_STRING Buffer;
|
UNICODE_STRING Buffer;
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz (&Buffer,
|
RtlCreateUnicodeStringFromAsciiz(&Buffer, (LPSTR)lpBuffer);
|
||||||
(LPSTR)lpBuffer);
|
|
||||||
|
|
||||||
bResult = SetComputerNameExW(NameType, Buffer.Buffer);
|
bResult = SetComputerNameExW(NameType, Buffer.Buffer);
|
||||||
|
|
||||||
|
@ -422,9 +432,9 @@ SetComputerNameExA (
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
SetComputerNameExW (
|
WINAPI
|
||||||
COMPUTER_NAME_FORMAT NameType,
|
SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
|
||||||
LPCWSTR lpBuffer)
|
LPCWSTR lpBuffer)
|
||||||
{
|
{
|
||||||
if (!IsValidComputerName(NameType, lpBuffer))
|
if (!IsValidComputerName(NameType, lpBuffer))
|
||||||
|
@ -433,24 +443,22 @@ SetComputerNameExW (
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( NameType ) {
|
switch( NameType )
|
||||||
|
{
|
||||||
case ComputerNamePhysicalDnsDomain:
|
case ComputerNamePhysicalDnsDomain:
|
||||||
return SetComputerNameToRegistry
|
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Services\\Tcpip\\Parameters",
|
L"\\Services\\Tcpip\\Parameters",
|
||||||
L"Domain",
|
L"Domain",
|
||||||
lpBuffer);
|
lpBuffer);
|
||||||
|
|
||||||
case ComputerNamePhysicalDnsHostname:
|
case ComputerNamePhysicalDnsHostname:
|
||||||
return SetComputerNameToRegistry
|
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Services\\Tcpip\\Parameters",
|
L"\\Services\\Tcpip\\Parameters",
|
||||||
L"Hostname",
|
L"Hostname",
|
||||||
lpBuffer);
|
lpBuffer);
|
||||||
|
|
||||||
case ComputerNamePhysicalNetBIOS:
|
case ComputerNamePhysicalNetBIOS:
|
||||||
return SetComputerNameToRegistry
|
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
( L"\\Registry\\Machine\\System\\CurrentControlSet"
|
|
||||||
L"\\Control\\ComputerName\\ComputerName",
|
L"\\Control\\ComputerName\\ComputerName",
|
||||||
L"ComputerName",
|
L"ComputerName",
|
||||||
lpBuffer);
|
lpBuffer);
|
||||||
|
@ -502,11 +510,9 @@ DnsHostnameToComputerNameA(LPCSTR Hostname,
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
DnsHostnameToComputerNameW (
|
DnsHostnameToComputerNameW(LPCWSTR hostname,
|
||||||
LPCWSTR hostname,
|
|
||||||
LPWSTR computername,
|
LPWSTR computername,
|
||||||
LPDWORD size
|
LPDWORD size)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue