//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // Confidential Trade Secret. // Copyright 1987-2001 Data Access Corporation, Miami FL, USA // All Rights reserved // DataFlex is a registered trademark of Data Access Corporation. // // Module: // GetComputerName.Pkg // // Purpose: // Defines interface to WinAPI function GetComputerName // // Author: // Vincent Oorsprong // // Date: // 2001, June, 4th // //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #IFNDEF GET_GetComputerName Define MAX_COMPUTERNAME_LENGTH For 15 External_Function WinAPI_GetComputerName "GetComputerNameA" Kernel32.Dll Pointer lpComputerName Dword nNameSize Returns Integer Function GetComputerName Desktop Returns String String sComputerName Dword dwNameSize Integer iRetval ZeroString MAX_COMPUTERNAME_LENGTH To sComputerName Move MAX_COMPUTERNAME_LENGTH To dwNameSize Move (WinAPI_GetComputerName (AddressOf (sComputerName), AddressOf (dwNameSize))) To iRetval Function_Return (CString (sComputerName)) End_Function // GetComputerName #ENDIF