From de9e545bcfdb8e8775da02fa23399e9b056a3226 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 25 Oct 1999 13:12:31 +0000 Subject: [PATCH] 19991025-14:58 GMT+1 Victor Szel --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/net.c | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 457b2d3a24..332d57ec18 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19991025-14:58 GMT+1 Victor Szel + * source/rtl/net.c + + Name buffer length corrected. + * Using a better API call for the same job. + 19991025-12:37 GMT+1 Victor Szel + source/tools/ctcrypt.c + source/tools/ctchrmix.c diff --git a/harbour/source/rtl/net.c b/harbour/source/rtl/net.c index 9241f08566..bdf20e5381 100644 --- a/harbour/source/rtl/net.c +++ b/harbour/source/rtl/net.c @@ -60,15 +60,12 @@ HARBOUR HB_NETNAME( void ) { #if defined(_Windows) || defined(WINNT) { - HKEY hKey; - DWORD ulLen = 128; + DWORD ulLen = MAX_COMPUTERNAME_LENGTH + 1; char * pszValue = hb_xgrab( ulLen ); pszValue[ 0 ] = '\0'; - RegOpenKey( HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName", &hKey ); - RegQueryValueEx( hKey, "ComputerName", NULL, NULL, pszValue, &ulLen ); - RegCloseKey( hKey ); + GetComputerName( pszValue, &ulLen ); hb_retc( pszValue ); hb_xfree( pszValue );